View previous topic :: View next topic |
Author |
Message |
Fabri
Joined: 22 Aug 2005 Posts: 275
|
write_eeprom and PIC18F4525 |
Posted: Thu May 29, 2008 3:23 am |
|
|
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
|
|
Posted: Thu May 29, 2008 6:27 am |
|
|
Address must be a 16 bit variable. I guess you are using an 8 bit. |
|
|
Fabri
Joined: 22 Aug 2005 Posts: 275
|
|
Posted: Thu May 29, 2008 7:16 am |
|
|
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
|
|
Posted: Thu May 29, 2008 7:54 am |
|
|
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
|
|
Posted: Thu May 29, 2008 8:51 am |
|
|
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
|
|
Posted: Fri May 30, 2008 8:13 am |
|
|
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
|
|
Posted: Fri May 30, 2008 8:19 am |
|
|
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 |
|
|
|