CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

write_eeprom & read_eeprom does not work on PIC18F452?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
John_Lintern



Joined: 30 Sep 2004
Posts: 14

View user's profile Send private message Send e-mail

write_eeprom & read_eeprom does not work on PIC18F452?
PostPosted: Thu Sep 08, 2005 5:47 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 08, 2005 5:59 am     Reply with quote

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

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Thu Sep 08, 2005 8:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 08, 2005 11:16 am     Reply with quote

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. Mr. Green

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group