??? 05/25/05 12:34 Read: times |
#93885 - movx a,@dptr Responding to: ???'s previous message |
Jan Waclawek said:
...is in the dump routine - you don't increment the EEPROM address in dptr.
dump_eep: lcall Chk_Dev ; MOV DPTR,#0000H dump: mov count,#010h mov R0,#030h dump1: LCALL EEPROM_READ inc dptr ;missing MOV A,DYTA ;read byte in DYTA mov @R0,a inc R0 djnz count,dump1 lcall PrintLine But I would object a lot of things in your program. The delay is there, the DELAY_STOP routine. Nevertheless, it depends on EEPROM type/brand and '51 type and clock, whether this is sufficient or not. Most EEPROMs implement a "polling" scheme so they "tell" you when the write is done. Read the EEPROM datasheet. Jan Waclawek PS. For formatted look of you program in the forum - just as above - enclose the program into <pre> and </pre> tags. Thank you Jan, that saved me from pulling my hair out (don't have much left after this) The problem was in the read routine. Since my test program only wrote the same byte to one line, the read_eep showed that it read correctly. It never dawned on me to check the eeprom with another programmer to see if the program was reading correctly. Since the timing was off also, it wrote the first byte in every line, and random bytes after that so there would be no way of checking if the write was successful since the read was not accurate. The code does need to be cleaned up considerably. I don't know how I missed the simple problem, but I guess I need to keep reading the "bible"! Thanks to everyone for your help. |
Topic | Author | Date |
movx a,@dptr! | 01/01/70 00:00 | |
I think your problem is... | 01/01/70 00:00 | |
No Michael | 01/01/70 00:00 | |
DYTA EQU 10H? | 01/01/70 00:00 | |
movx a,@dptr | 01/01/70 00:00 | |
code format | 01/01/70 00:00 | |
WHICH EEPROM | 01/01/70 00:00 | |
the error... | 01/01/70 00:00 | |
movx a,@dptr![]() | 01/01/70 00:00 |