??? 04/12/10 07:54 Read: times |
#174988 - You have to choose your API Responding to: ???'s previous message |
Your first step is to decide HOW you want to call any EEPROM functions. I originally gave you a function that takes the 'offset into the internal eeprom space' as an integer. e.g. 0x0123 would access the 0x123'th cell in the eeprom area.
With 8051 compilers, they have the notion of an xdata variable. So you can declare absolute memory locations in exactly the same way as you have for the memory-mapped LCD. However you have two different xdata's. So you would need to make sure the Compiler knows how to do the extra little instructions. Which is why it is easiest to use a function to read and write the eeprom. You would have to force an absolute location for your eeprom_variable. Pass its eeprom_address and the function looks after the read or write. e.g. char xdata eeprom_david @ 0x0123; ... contents = EEPROM_Read(&eeprom_david); contents = EEPROM_Read(0x0123); Most people use EEPROM for fixed storage of data. i.e. you want to specify what lives at 0x000 or at 0x123 etc. So using the integer offset is more intuitive. But it is YOUR program and YOUR choice of how you want to invoke YOUR functions. Incidentally, I gave you some code that I know works with other controllers. I would suggest that you try it for yourself. David. |
Topic | Author | Date |
EEPROM Read/Write Issues | 01/01/70 00:00 | |
if it was an external EEPROM | 01/01/70 00:00 | |
if it was an external EEPROM | 01/01/70 00:00 | |
Special sequence. | 01/01/70 00:00 | |
Thanks, but can you please simplyfy it? | 01/01/70 00:00 | |
Hope this explains | 01/01/70 00:00 | |
Managed to fix lockups, but it doesnt read/write | 01/01/70 00:00 | |
You have to choose your API | 01/01/70 00:00 | |
Already did all that | 01/01/70 00:00 | |
char vs int | 01/01/70 00:00 | |
I gave you a function | 01/01/70 00:00 | |
Still no luck | 01/01/70 00:00 | |
unsigned int is not the size of the unsigned int* pointer | 01/01/70 00:00 | |
Why not use the function I gave you. | 01/01/70 00:00 | |
I did use you function | 01/01/70 00:00 | |
My apologies. | 01/01/70 00:00 | |
Sorry to keep dragging you back here... | 01/01/70 00:00 | |
FLIP is a pain | 01/01/70 00:00 | |
We have progress! | 01/01/70 00:00 | |
Terribly sorry to bump but I really need help | 01/01/70 00:00 | |
Found the solution! | 01/01/70 00:00 | |
Study your C textbooks | 01/01/70 00:00 | |
it cant distinguise the sign bit![]() | 01/01/70 00:00 |