Hi everyone!
I'm using PIC16f877a and I program it this way:
'PIC DEFINES
'--------------------
@ DEVICE pic16f877a, XT_OSC
@ DEVICE pic16f877a, WDT_ON
@ DEVICE pic16f877a, PWRT_ON
@ DEVICE pic16f877a, BOD_ON
@ DEVICE pic16f877a, LVP_OFF
@ DEVICE pic16f877a, CPD_OFF
@ DEVICE pic16f877a, PROTECT_OFF
@ DEVICE pic16f877a, WRT_OFF
'LCD DISPLAY
'--------------------
DEFINE LCD_DREG PORTA
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 2
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
'DEFINE LCD_COMMANDUS 2000
'DEFINE LCD_DATAUS 50
ADCON1=7
prnt var byte[2]
TRISB=%00000000
TRISC=%00000000
TRISD=%00000001
CMCON=%00000111
'CVRCON=%0000000
OPTION_REG.7=0
EEPROM 0,[1]
EEPROM 1,[8]
lcdout $fe,1,"Reading eeprom"
read 0,prnt[0]
read 1,prnt[1]
lcdout $fe,1,"Reading=",#prnt[0],#prnt[1]
end
When I load the hex file I can see the values 1 and 8 stored in eeprom address 0 and 1 respectively.My problem is that it can't read those values. the lcd will just display "Reading=00".Please help me
Try this for grins, same thing but different...
Should say "Reading=18" when it's run.Code:loc0 var byte loc1 var byte ................. write 0,1 write 1,8 lcdout $fe,1,"Reading eeprom" read 0,loc0 read 1,loc1 lcdout $fe,1,"Reading=",DEC loc0,DEC loc1 end
I also got problem writing the eeprom. I program it this way:
lcdout $fe,1,"writing the eeprom"
write 0,2
write 1,3
pause 2000
lcdout $fe,1,"Successful!"
end
The output is terrible.It will just make the lcd display "writing the eeprom" and it will keep on refreshing...
Please help me...
Use a STOP or an endless loop before the END statement.
Code:pause 2000 lcdout $fe,1,"Successful!" Here: GOTO Here end
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steve!
I placed an endless loop before the END, but still i got the same output.
What should I do?
Please help...
Bookmarks