View previous topic :: View next topic |
Author |
Message |
John_Lintern
Joined: 30 Sep 2004 Posts: 14
|
write_eeprom & read_eeprom does not work on PIC18F452? |
Posted: Thu Sep 08, 2005 5:47 am |
|
|
I am emulating a PIC18F452 on an ICE2000 (using the PCM18XH2 processor module).
However, the commands write_eeprom & read_eeprom do not to work ?
When I use a breakpoint on the statement...
write_eeprom(0x10,0x55)
it should write the value 0x55 to EEPROM address 0x10.
But nothing happens.
The same program and statement works fine when I emulate it as a PIC16F877A (using the PCM16XV0 processor module).
Is there something different I need to do when using the EEPROM on the PIC18 ? |
|
|
John_Lintern
Joined: 30 Sep 2004 Posts: 14
|
|
Posted: Thu Sep 08, 2005 5:59 am |
|
|
Ive just found out.... I can read the eeprom but not write to it.
So its as if its protected ?
But I have set the config for it not to be write protected using the statement....
#FUSES NOWRTD //Data EEPROM not write protected |
|
|
MikeValencia
Joined: 04 Aug 2004 Posts: 238 Location: Chicago
|
|
Posted: Thu Sep 08, 2005 8:04 am |
|
|
I'm using an 18f458, which is essentially the same thing as a '452, plus CAN.
My #fuse statements are:
Code: |
#include <18F458.h>
#device ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLVP,PUT
#use delay(clock=8000000)
|
I can do write_eeprom and read_eeprom just fine.
Try using a real '452 chip, not the ICE2000. It just might be the ICE's fault. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Sep 08, 2005 11:16 am |
|
|
I saw your post on the Microchip forum. One problem is that you're
asking ICE questions on this forum, and asking CCS questions on
the Microchip forum (at least in part). It needs to be the other way
around.
To answer your question of how to store bytes with the #rom statement,
see the following thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=23914&highlight=rom+int8 |
|
|
|