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

EEDATA memory question

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



Joined: 08 Jan 2005
Posts: 7

View user's profile Send private message

EEDATA memory question
PostPosted: Mon Jan 10, 2005 1:35 pm     Reply with quote

I need to write 0xFF to the last address of data memory. I am using a PIC18F452.

What is that address for this chip.

And, another question, which function should I use: WRITE_PROGRAM_EEPROM or WRITE_EEPROM ???
garyzheng



Joined: 22 Jul 2004
Posts: 25

View user's profile Send private message

i think you can try write_prgramme_eeprom
PostPosted: Mon Jan 10, 2005 1:48 pm     Reply with quote

i used this command before. it can work:)
but you should know where your program memory is empty? don't occupy the place where the program is:)
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jan 10, 2005 1:54 pm     Reply with quote

There are two ways to do it. You can use a #rom statement,
or you can use the write_eeprom() function, as shown in the
program below.
Code:
#include <18F452.h>
#fuses XT,PROTECT,PUT,BROWNOUT,NOLVP,NOWDT
#use delay(clock=4000000)

// This method sets the last byte of data eeprom = 0xFF
// in the HEX file.   The data eeprom will be set to 0xFF
// when the PIC is programmed with the ICD2, PicStart-Plus, etc.
// Notes:
// The base address of data eeprom is 0xF00000 for the 18F452.
// There are 256 bytes of data eeprom, so the address of the
// last byte is 0xF00000 + 0xFF = 0xF000FF.
#rom 0xF000FF = { 0xFF }

//===================
void main()
{

// This method writes 0xFF to the last byte of data eeprom
// when your program is running. (ie., at "run time").
write_eeprom(0xFF, 0xFF);  //   address, data

while(1);
}
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