![]() | ![]() | ![]() |
| | |||||||
| 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? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| without, at least, the code it's hard to say what's wrong
__________________ Steve | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| thanks mate....i'll try it Tamil | |
| |