Melanie,
Thanks for your fast reply, I will work this out and let you know the outcome later.
regards,
joe
Melanie,
Thanks for your fast reply, I will work this out and let you know the outcome later.
regards,
joe
Thank you for the great sample, Melanie.
The comments make it a real tutorial on reading and writing to EEPROM. The logic and flow are a glimpse into the world of how professionals write code. Very impressive.
I will be studying this masterpiece for some time to come.
-Adam-
Ohm it's not just a good idea... it's the LAW !
Hi Melanie!
Is the sample.bas that you posted about how to read and write the EEPROM applicable for 16F877A?
If not, what certain modifications should be done?
Please help...
ria
Adam - *blush* personally Signed framed Masterpieces are available in exchange for internationally negotiable crinkly drinking vouchers...
Ria - Yes it is, with a few changes...
1. Change ALL the PIC defines to 877A instead 876A...
eg
@ DEVICE pic16F876A, XT_OSC
becomes
@ DEVICE pic16F877A, XT_OSC
2. Add additional TRIS statements to account for Ports D and E.
eg
TRISE=%11111111
Remembering that parts of PortE will still have Analog on them...
3. Compile with the command line
PBPW -p16f877A sample -v
I see..
Thank you so much Melanie..
I really learn a lot from this forum.
Cheers!
ria
By the way Melanie..why we need to use PBPW instead of PBP in compiling?
What's the difference between them?
Hi Melanie,
I got your code running, initially I placed '9999' at memory location 0. I'm trying
to read it from the internal memory, So I try this code below. But when I press the button I got '655535'
instead the initial value '9999'.
TRISB=%00010000 ' All PortB is Output - except
' B.3 = Button
TRISC=%00000000 ' All PortC is Output
CMCON=%00000111 ' Disable Comparators
CVRCON=%00000000 ' Disable Reference Module
OPTION_REG.7=0 ' Enable Weak Pull-Up's
Pause 2000
ButtonPRESS var PortB.4 ' Push Button
WORDVariable var WORD
PromptLoop:
Serout PortC.1,6, [$FE,1,"Press Button..."]
While ButtonPRESS=1:Wend ' Wait here until Button Pressed
READ 0,WORDVariable.HighByte ' Reconstruct Word variable from EEPROM
READ 1,WORDVariable.LowByte
Serout PortC.1,6, [$FE,1,"Reading=",#WORDVariable] ' Display Result
While ButtonPress=0:Wend ' Wait here as long as finger is on Button
Goto PromptLoop
'
End
Thanks for the time, appreciate it very much,
joe
Bookmarks