x_ben
Joined: 23 Jan 2004 Posts: 1
|
PIC18F458 eeprom write problem |
Posted: Fri Jan 23, 2004 3:48 pm |
|
|
hi!
Since yesterday, I'm trying to write ONE byte into the PIC18F458 eeprom... first, I used MPLAB v6.40 and High-Tech v8.30 "C" compiler. When I simulate my program witch MPLAB, it works: the data is written where I want in the eeprom. But, when I burn it into the chip, wait for the write an read it, the eeprom is still blank! (0xFF everywhere...)
I tried to code my program in ASM.. the simulating works but the "real" eeprom is still blank again..
Is aybody knows what could be my problem???
Thanks!
Here is my code in ASM:
org 0x00;
goto Write;
Write
MOVLW 0x00;
MOVWF EEADR;
MOVLW 0x77;
MOVWF EEDATA;
BCF EECON1,EEPGD;
BCF EECON1,CFGS;
BSF EECON1,WREN;
MOVLW 0x55;
MOVWF EECON2;
MOVLW 0x0AA;
MOVWF EECON2;
BSF EECON1,WR;
Write2
BTFSC EECON1,WR;
GOTO Write2;
BCF EECON1,WREN;
BCF PIR2,EEIF;
END
;//An "equates's" file is included for the registers's and bytes adresses.. |
|