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

Internal EEPROM bigger than 256 byte

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



Joined: 06 Feb 2006
Posts: 468
Location: Bali

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

Internal EEPROM bigger than 256 byte
PostPosted: Sat Oct 05, 2019 8:25 pm     Reply with quote

Hi

I would like to read/write to an internal EEPROM (PIC18F26K22) that have 1024 bytes.
For 256 bytes I used:
Code:
eepromreaddata0=read_eeprom(eepromaddress);
write_eeprom(eepromaddress,eepromwritedata0);

and it is working
It is correct to use for 1024 bytes:
Code:
eepromaddress=make16(eepromaddresshigh,eepromaddresslow);
eepromreaddata0=read_eeprom(eepromaddress);

I am sending eepromaddresshigh (0 to 3) and eepromaddresslow (0 to 255) from the PC to the PIC.
I would like to know if the above correct before going forward with this part of the project.

Best wishes
Joe
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Sun Oct 06, 2019 1:34 am     Reply with quote

Yes, but remember that the variable 'eepromaddress', is going to need to be
declared as a 16bit value, not a simple 8bit 'int'.
gjs_rsdi



Joined: 06 Feb 2006
Posts: 468
Location: Bali

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

PostPosted: Mon Oct 07, 2019 3:35 pm     Reply with quote

Thank you very much Ttelmah Smile
I can go forward with the project.

Best wishes
Joe
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