View previous topic :: View next topic |
Author |
Message |
Charles Linquist
Joined: 07 May 2005 Posts: 28 Location: Campbell, CA
|
EEPROM addressing |
Posted: Tue May 31, 2005 5:18 pm |
|
|
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
|
|
Posted: Tue May 31, 2005 6:35 pm |
|
|
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
|
|
Posted: Tue May 31, 2005 9:51 pm |
|
|
Thanks! |
|
|
|