i'm desperate!!!
i have changed scl and sda pins to portB..nothing
i have changed resistor to 4k7....nothing
this is my all code:
@ DEVICE XT_OSC, WDT_OFF, PWRT_ON, PROTECT_OFF
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 2
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
' DEFINE I2C_SCLOUT 1
SCL var PORTA.2
SDA var PORTA.3
TEMP var BYTE
TEMP=0
MAIN:
PAUSE 1000
LCDOUT $FE, 1
LCDOUT #TEMP
' i2cwrite sda,scl,$9A,$1,[$00],NOREAD
i2cwrite sda,scl,$9A,$1,[$00]
' pause 1000
i2cread sda,scl,$9A,$0,[temp] ' Read temperature
goto prox
noread: lcdout "noread"
prox: GOTO MAIN
END
with the noread label the display always screens "0 noread"
without noread label the display always screens "2"
the same thing also with the pause between write and read and with or without the I2C_SLOUT option
i attach an image with the hardware config...
please save me!!!!!
thanks!!!!
Bookmarks