View previous topic :: View next topic |
Author |
Message |
gernot Guest
|
Can not write in internal EEPROM PIC18F252 |
Posted: Tue Mar 25, 2003 4:17 pm |
|
|
Can not write in internal EEPROM PIC18F252.
I use this code:
B1=12;
B2=24;
write_EEPROM(adr, B1) ;
write_EEPROM(adr+1, B2) ;
B1=read_EEPROM(adr);
B2=read_EEPROM(adr+1);
... and B1/B2 after read is always 0xFF :-((
Thanks for help.
___________________________
This message was ported from CCS's old forum
Original Post ID: 13063 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Can not write in internal EEPROM PIC18F252 |
Posted: Tue Mar 25, 2003 4:30 pm |
|
|
:=Can not write in internal EEPROM PIC18F252.
:=I use this code:
:=B1=12;
:=B2=24;
:=write_EEPROM(adr, B1) ;
:=write_EEPROM(adr+1, B2) ;
:=B1=read_EEPROM(adr);
:=B2=read_EEPROM(adr+1);
:=
:=... and B1/B2 after read is always 0xFF :-((
:=
------------------------------------------------------------
What's your version of the PCH compiler ?
Here are some lines from the old CCS versions page:
3.092 Some EEPROM write issues are resolved
3.093 Another PIC18 EEPROM issue fixed
3.104 PIC18 PROGRAM_EEPROM read/write fixed/changed -- See readme.txt
___________________________
This message was ported from CCS's old forum
Original Post ID: 13065 |
|
|
TSchultz
Joined: 08 Sep 2003 Posts: 66 Location: Toronto, Canada
|
RE: Can not write in internal EEPROM PIC18F252 |
Posted: Wed Mar 26, 2003 5:46 am |
|
|
:=Can not write in internal EEPROM PIC18F252.
:=I use this code:
:=B1=12;
:=B2=24;
:=write_EEPROM(adr, B1) ;
:=write_EEPROM(adr+1, B2) ;
:=B1=read_EEPROM(adr);
:=B2=read_EEPROM(adr+1);
:=
:=... and B1/B2 after read is always 0xFF :-((
:=
:=Thanks for help.
Make sure you have the fuses set correctly to allow writing of the EEPROM. This one caught me when I switched from the PIC16F877 to the PIC18F452. There are many more fuse settings that need to be correct for FLASH and/or EEPROM write, also the WDT is now controlled by fuse settings as well.
-Troy
___________________________
This message was ported from CCS's old forum
Original Post ID: 13078 |
|
|
gernot Guest
|
Problem solved |
Posted: Wed Mar 26, 2003 6:09 am |
|
|
Thanks for the help :-))
Fuse was the problem.
___________________________
This message was ported from CCS's old forum
Original Post ID: 13079 |
|
|
|