Hi, something like the following will work.
Code:EEP1 con %10100000 ' First EEPROM A<2:0>=Gnd Addr var word ByteA var byte ByteB var byte PAUSE 50 addr=0 BYTEA="A" byteb="B" I2CWRITE SDA,SCL,EEP1,ADDR,[bYTEA," TEXT1",BYTEB," TEXT2"] PAUSE 10 FOR ADDR=0 TO 13 I2Cread SDA,SCL,EEP1,ADDR,[bYTEA] hserout [BYTEA] next @ GOTO $
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
in your first example, try to change to..
Code:<font color="#000000"> @ __CONFIG _XT_OSC & _WDT_ON & _PWRTE_ON & _BODEN_ON & _LVP_OFF <font color="#000080">DEFINE </font>OSC 4 <font color="#000080">INCLUDE </font>"Modedefs.bas" <font color="#000080">DEFINE </font>LCD_DREG PORTB <font color="#000080">DEFINE </font>LCD_DBIT 4 <font color="#000080">DEFINE </font>LCD_RSREG PORTB <font color="#000080">DEFINE </font>LCD_RSBIT 3 <font color="#000080">DEFINE </font>LCD_EREG PORTB <font color="#000080">DEFINE </font>LCD_EBIT 2 SDA <font color="#000080">VAR </font>PORTC.4 SCL <font color="#000080">VAR </font>PORTC.3 J <font color="#000080">VAR WORD </font>i <font color="#000080">VAR WORD </font>c <font color="#000080">VAR BYTE </font>variabila1 <font color="#000080">VAR BYTE </font>variabila2 <font color="#000080">VAR BYTE </font>variabila1="A" variabila2="B" i=0 J=0 ADCON1 = 7 TRISB = 0 start: <font color="#000080">I2CWRITE </font>SDA, SCL,$A0,i,["TEXT1",variabila1," TEXT2",variabila2] <font color="#000080">LCDOUT </font>$FE,1 <font color="#000080">LCDOUT </font>$FE,$80,"INCERCARI" <font color="#000080">LCDOUT </font>$FE,$C0 <font color="#000080">FOR </font>J = 0 <font color="#000080">TO </font>12 <font color="#000080">I2CREAD </font>SDA, SCL,$A0,J,[c] <font color="#000080">LCDOUT </font>c <font color="#000080">NEXT </font>J @ <font color="#000080">GOTO </font>$
Last edited by mister_e; - 27th March 2008 at 22:23.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
no it works here, look at post #10
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I have write your code ..and display " ATEXT1 BTEXT2 " BUT NOT ALL TOGETHER -alternately . If will be remain all karakters on the display -ALL WILL BE OK !
Addr var word
ByteA var byte
ByteB var byte
PAUSE 50
addr=0
BYTEA="A"
byteb="B"
I2CWRITE SDA,SCL,$A0,ADDR,[bYTEA," TEXT1",BYTEB," TEXT2"]
PAUSE 10
reading:
FOR ADDR=0 TO 13
I2Cread SDA,SCL,$A0,ADDR,[bYTEA]
lcdout $FE,1
LCDOUT $FE,$80,"INCERCARI"
LCDOUT $FE,$C0+addr ,ByteA ' HERE I WRITE " +ADDR " BECOSE HE WRITE IN THE SAME PLACE
pause 300
next
pause 400
Enable
goto scriere
Last edited by Eugeniu; - 27th March 2008 at 22:40.
POST #10, not #9
anyways, look what your actual code do...
hence why i've move most LCDOUT BEFORE the FOR/NEXT loop.... twice.Code:FOR ADDR=0 TO 13 I2Cread SDA,SCL,$A0,ADDR,[bYTEA] lcdout $FE,1 ' it always clear your LCD and return to home LCDOUT $FE,$80,"INCERCARI" ' it always draw this line LCDOUT $FE,$C0+addr ,ByteA ' and finally here, it will only draw a single character, because you ALWAYS clear the WHOLE lcd with $FE,1 pause 300 next
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Grreeeeeeeeeeeeeat! Enjoy!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks