Hi SuB-ZeRo,
I'm a beginner to PBP but I think that you are trying to write a WORD into a BYTE.
If I look in the PBP manuel under WRITE there is this example:
w var word
WRITE 0,w.BYTE0
WRITE 1,w.BYTE1
Regards
Gert K.
Hi SuB-ZeRo,
I'm a beginner to PBP but I think that you are trying to write a WORD into a BYTE.
If I look in the PBP manuel under WRITE there is this example:
w var word
WRITE 0,w.BYTE0
WRITE 1,w.BYTE1
Regards
Gert K.
*Let's do it*
look at this part located at the top
replace your counter=0 by read 10, counterCode:time VAR BYTE time =0 counter VAR WORD counter =0
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yes i change the codes and now i can write to eeprom.The new problem is counting can't go more than 255 whats the problem?
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
sayac var word
b1 var byte
sayac =0
lcd_goster:
read 5,sayac
lcdout $Fe,1
Lcdout "sayac"
LCDOut $Fe,$C0
lcdout "total=",#sayac
loop:
button porta.4 ,0,0,0,b1,1,ok
goto loop:
ok:
data @5,0
read 5,sayac
sayac=sayac+1
write 5,sayac
goto lcd_goster
end
Asking is not a shame but not learning is a SHAME!!!
i'm not sure on how PBP handle WRITE when using a WORD sized var but i think Sharky was right on his previous post.
SO what about using something like...
Code:MyVar var word AnotherVar var word myvar=12345 Write 0,Myvar.highbyte write 1,myvar.lowbyte ' code ' code ' code ' code Read 0,anothervar.highbyte read 1,anothervar.lowbyte
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Ok! I resolved the problem by u re suggests.Here re the working codes.
I am always wrting the codes coz if somebody has or will the same problem they can find the way how to resolve by working codes
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
sayac var word
sayac=0
sayac_goster var word
sayac_goster = 0
b1 var byte
lcd_goster:
read 5,sayac_goster.highbyte
read 6,sayac_goster.lowbyte
lcdout $Fe,1
Lcdout "sayac"
LCDOut $Fe,$C0
lcdout "total=",#sayac_goster
loop:
button porta.4 ,0,0,0,b1,1,ok
goto loop:
ok:
data @5,0
data @6,0
read 5,sayac_goster.highbyte
read 6,sayac_goster.lowbyte
sayac_goster = sayac_goster + 1
sayac=sayac_goster
write 5,sayac.highbyte
write 6,sayac.lowbyte
goto lcd_goster
end
Asking is not a shame but not learning is a SHAME!!!
Bookmarks