Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 7th September 2006, 01:17 PM   (permalink)
Default Interfacing I2C IC with Proton Developement Board V1.0

Hi all.....I'm trying to interface an 8-bit ADC circuit to a proton development board via a I2C IC (PCF 8574P)....but all i'm getting on the LCD is 11111111 regardless of what the input is....i know for certain that the ADC works as i'm getting the correct value on the LCD when i connect the ADC directly to the proton board....i've checked to make sure the all appropriate pins have been grounded.....the proton board uses a 16F877A Pic....does anyone have any suggestions? thank you for your time.

regards
Tamil
Tamil.selvam is offline  
Old 7th September 2006, 03:40 PM   (permalink)
Default

without, at least, the code it's hard to say what's wrong
__________________
Steve
mister_e is offline  
Old 7th September 2006, 03:45 PM   (permalink)
Default

Hi Steve....here is my code....
Device 16F877A
XTAL = 20

ALL_DIGITAL = True

Declare SDA_PORT PORTC.4
Declare SCL_PORT PORTC.3
Declare HBUS_BITRATE 100


Dim ADC_Data As Byte

LCD_DTPIN = PORTD.4
LCD_ENPIN = PORTE.1

LCD_RSPIN = PORTE.0
LCD_LINES = 2

Main:

HBStart
HBusOut %01000100

If SSPCON2.6 = %1 Then
Cls
Print "No Ack"
DelayMS 3000
Else
ADC_Data = HBusIn
Cls
Print Dec ADC_Data
DelayMS 1000
End If


HBStop


GoTo Main

End sub

regards
Tamil
Tamil.selvam is offline  
Old 7th September 2006, 04:02 PM   (permalink)
Default

i think you need to examine your handshaking a bit

try using the high level i2c commands first, hbusin addr, loc, [data] ... and then try the low level

if I recall, a read happens like this

start
write device address R/w = w
write memory address
restart
write device address R/w = R
read
ack or stop
__________________
If you don't have a planet, what good are gold bars?

want to contact me directly? gmail gordonthree
check out my project website: http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
justDIY is offline  
Old 7th September 2006, 04:07 PM   (permalink)
Default

thanks mate....i'll try it
Tamil
Tamil.selvam is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 10:58 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

eXTReMe Tracker