??? 04/13/10 10:15 Read: times |
#175016 - Sorry to keep dragging you back here... Responding to: ???'s previous message |
David Prentice said:
Sorry, I had obviously never used the EEPROM of the 5131. I had just added the conditional code to my library "eeprom.c" without testing on that particular device. I can assure you that the 8252 version works fine. Dont worry, its only human to make mistakes :) and as I said, you did help me fix the hangups so we are making progress :) David Prentice said:
Please use the following functions: unsigned char rdeeprom(unsigned char xdata *ads) { unsigned char c; EECON = 2; /* EEE */ AUXR |= (1<<5); /* MO */ c = *ads; /* needs no cast cos in signature */ AUXR &= ~(1<<5); /* MO = 0 */ EECON = 0; /* brute force */ return c; } void wreeprom(unsigned char xdata *ads, unsigned char c) { EECON = 2; /* EEE */ *ads = c; /* needs no cast cos in signature */ EECON = 0x52; /* SPECIAL SEQUENCE */ EECON = 0xA2; /* I had written wrong sequence */ while (EECON & 1); /* EEBUSY */ EECON = 0; /* brute force */ } Well, the LCD did display different letters, just like the box's only 4 of the small dots were displaying... but they probably just started malfunction because theres no char like this on the ASCII char or the character patterns on the LCD datasheet. David Prentice said:
You can read your EEPROM contents via FLIP. I also noticed that the 5131 seems to manage to read the EEPROM ok without stretching the read-cycle i.e. without setting the MO bit.
David. I tried to read the EEPROM from FLIP several times, but I didnt really understood it. first of all the Window is titled "EEPROM Buffer" so I am unsure if its really the EEPROM data inside... and eitherway it always displays FF (the virgin EEPROM value you mentioned) I think I may have a clue whats causing the problem.heres something from the Datasheet I skipped it over previously because I figured its a typo but maybe its something of note: "Data is written by byte to the column latches as for an external RAM memory. Out of the
11 address bits of the data pointer, the 4 MSBs are used for page selection (row) and 7 are used for byte selection. Between two EEPROM programming sessions, all the addresses in the column latches must stay on the same page, meaning that the 4 MSB must not be changed." 3FF is a maximum of 10(assuming you excluse the first two zeros in the beginning, otherwise its 12 bits) bits. now if the first 4 of 11 is the address then maybe it changed the whole value? another part I may have misunderstood: The number of data written on the page may vary from 1 to 128 bytes (the page size).
When programming, only the data written in the column latch is programmed [b]and a ninth bit[/b] is used to obtain this feature. This provides the capability to program the whole memory by bytes, by page or by a number of bytes in a page. Indeed, each ninth bit is set when the writing the corresponding byte in a row and all these ninth bits are reset after the writing of the complete EEPROM row. I tried to set and unset the ninth bits several times (by making the c variable an int and doing (c=c| 0x100) but it didnt change a thing. |
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 |