if you want to use the internal EEPROM use READ and WRITE command. You don't need to declare anything else. Everything is explain in the PBP manual.
if you want to use the internal EEPROM use READ and WRITE command. You don't need to declare anything else. Everything is explain in the PBP manual.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
thank for the replys.
i have tried using the read command and the write command. it gives me errors in my program at the compiing stage. it says something like undefined symbol 'WREN" or undefined symbol 'pgd' or somehing theres about 6 in all.
i am using the 16f73 and i think that the data sheet for it says that there is non-volatile eeprom memoery onboard that i can use. but not 100% sure if my pic has this memory.
i will look into the shiftin commands. thanks
i am simply trying to store about 6, byte sized variables in all. the variables are to be saved at power down and loaded at power up.
i didn't read the datasheet but i'll trust you on the fact it doesn't have any internal EEPROM. In this case, you can still skip the external EEPROM idea and use the code space to save your variables.
see this thread from Melanie
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
thanks for the help so far. sry i got back to this so late but i haven't yet solved this problem. since my boards are already have an external eeprom (93c46), i have decided to use it. i just cant grasp how the eeprom works and need help understanding some things.
1. Does the eeprom have command instructions seperate from data instructions?
2. how does the informatiopn flow? are there byte sized instruction signals that tell the eeprom to get ready for data then it sends the data byte?
3. or is the instrunction on the msb of a word or something? or a bit in the sequence?
4. do i need to define a port speed?
if you dont want to answer these can you suggest any references that have an example of writing and reading from these external eeproms?
i have a pic of how my eeprom is on the pcb on a post by me, in this topic.
thanks!
oh yeah, i really would like an example that doesnt have lcd stuff in it
I am trying to write just 3, byte sized variables to the external eeprom and recall them at power up.
heres the data sheet for my eeprom:
http://www.datasheetarchive.com/sear...c46&sType=part
what should my trisB and TRISC be?? are they all outputs except for D0 (data out on epprom)
CS - PORTB.1
CLK - PORTB.2
D1 - PORTC.6
D0 - PORTC.7
this is what i have so far:
include "modedefs.bas"
D var byte
T var byte
ED var byte
addr var word
B0 var byte
eeread:
for addr = 0 to 2 'eeprom address
PORTB.1 = 1 'cs = 1
Shiftout PORTC.6, PORTB.2, MSBFIRST, [$03, addr.byte1, addr.byte0]
PORTB.1 = 0 'cs = 0
PAUSE 1
PORTB.1 = 1
Shiftin PORTC.7, PORTB.2, MSBPRE, [B0]
PORTB.1 = 0
if addr = 0 then
d = B0
endif
if addr = 1 then
t = B0
endif
if addr = 2 then
ED = B0
endif
next addr
return
eewrite:
for addr = 0 to 2
if addr = 0 then
B0 = D
endif
if addr = 1 then
B0 = T
endif
if addr = 2 then
B0 = ED
endif
PORTB.1 = 1
Shiftout PORTC.6, PORTB.2, MSBFIRST, [$06]
PORTB.1 = 0
PAUSE 1
PORTB.1 = 1
Shiftout PORTC.6, PORTB.2, MSBFIRST, [$02, addr.byte1, addr.byte0, B0]
PORTB.1 = 0
next addr
return
this is not all the code, but i want "encapsulated" SUBs that will take care of the reading and writing to the eeprom. so that is all i have shown.![]()
Bookmarks