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

EEPROM addressing

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



Joined: 07 May 2005
Posts: 28
Location: Campbell, CA

View user's profile Send private message

EEPROM addressing
PostPosted: Tue May 31, 2005 5:18 pm     Reply with quote

In the CCS manual, it states that in the syntax of the

write_eeprom (address,value)

command on page 194, both "address" and "value" are of type int8

Is this an error? I need to address EEPROM in devices
that have 1024 bytes of EEPROM. Is there a "trick"?
Can "address" really be int16?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 31, 2005 6:35 pm     Reply with quote

If you have doubts about what the compiler is doing (or is capable
of doing), you should compile a test program and look at the .LST file.
Here's part of a test program for the 18F8620, which has 1024 bytes of
data eeprom. If you look in the PIC's data sheet, you can see what
registers the code refers to. I've added them below as comments.

Code:

0000                00437 ..... write_eeprom(0x3FF, 0x55); 
0014 0E03           00438 MOVLW  03
0016 6EAA           00439 MOVWF  FAA   // EEADRH
0018 0EFF           00440 MOVLW  FF
001A 6EA9           00441 MOVWF  FA9   // EEADR
001C 0E55           00442 MOVLW  55
001E 6EA8           00443 MOVWF  FA8   // EEDATA
Charles Linquist



Joined: 07 May 2005
Posts: 28
Location: Campbell, CA

View user's profile Send private message

PostPosted: Tue May 31, 2005 9:51 pm     Reply with quote

Thanks!
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