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 and PIC18F4525

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



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

write_eeprom and PIC18F4525
PostPosted: Thu May 29, 2008 3:23 am     Reply with quote

Hi to all,

I'm in trouble with write_eeprom and PIC18F4525. I can write and read eeprom till 0xFF address.
Does address is a (8 bit or 16 bit depending on the part) ?

I'm using ccs PCWH 3,249

Have you got any suggestion about ?

Regards,
Fabri
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu May 29, 2008 6:27 am     Reply with quote

Address must be a 16 bit variable. I guess you are using an 8 bit.
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Thu May 29, 2008 7:16 am     Reply with quote

I try this simple code:
Code:

write_eeprom(0x0125,0x34);


After read eeprom I found at address 0x25 data 0x34.
at address 0x0125 I found 0xFF

Have you got any suggestion ?

Regards,
Fabri
RArtz



Joined: 28 May 2008
Posts: 7

View user's profile Send private message

PostPosted: Thu May 29, 2008 7:54 am     Reply with quote

ckielstra wrote:
Address must be a 16 bit variable. I guess you are using an 8 bit.


Syntax:
write_eeprom (address, value)

Parameters:
address is a (8 bit or 16 bit depending on the part) int, the range is device dependent

value is an 8 bit int

that was taken from the help file for CCS C.

I would suggest trying an 8 bit address instead of a 16 bit.
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Thu May 29, 2008 8:51 am     Reply with quote

I red the CCS help file, It was the first thing I did.

Anyway there was an error in compiler device editor.

After correct write_eeprom work fine all around eeprom of PIC18.

Thanks to all for support me,

Regards,
Fabri
ntgcp_08



Joined: 21 Feb 2008
Posts: 24

View user's profile Send private message

PostPosted: Fri May 30, 2008 8:13 am     Reply with quote

Can you share what the error in the compiler device editor was? And can you share what you corrected to make it work?

Thanks
Fabri



Joined: 22 Aug 2005
Posts: 275

View user's profile Send private message

PostPosted: Fri May 30, 2008 8:19 am     Reply with quote

with support of CCS I verify in:

TOOLS > DEVICE EDITOR > PIC18F4525

Under memory must be DATA EE = 1024

I correct it to 1024 from 255.

Regards,
Fabri
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