View previous topic :: View next topic |
Author |
Message |
proyectanteATE
Joined: 02 Feb 2011 Posts: 4
|
function erase_eeprom() in PIC18F4680 |
Posted: Wed Feb 02, 2011 4:11 pm |
|
|
Hi!!
I am doing a program for PIC18F4680 and need to erase storage addresses of the EEPROM, I want to use the function erase_eeprom (address) but the PIC COMPILER C does not recognize me.
And it shows me the following mistake: Error 12 "can_rutinasCCS.c" Line 169(13,14): Undefined identifier -- erase_eeprom
Why does this happen? And How does it solve?
Thanks!!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 02, 2011 4:56 pm |
|
|
It doesn't apply to the 18F4680. The CCS manual says it only works
with PICs that are supported by the PCB compiler (18F4680 uses the
PCH compiler). From the manual:
Quote: |
erase_eeprom( )
Syntax: erase_eeprom (address);
Parameters: address is 8 bits on PCB parts.
Returns: undefined
Function: This will erase a row of the EEPROM or Flash Data Memory.
Availability: PCB devices with EEPROM like the 12F519
Requires: Nothing
Examples: erase_eeprom(0); // erase the first row of the EEPROM (8
bytes) |
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19504
|
|
Posted: Thu Feb 03, 2011 3:27 am |
|
|
On the smaller devices, the EEPROM, is effectively a standard 'external' EEPROM, built onto the die, and has a row erase. The EEPROM on the larger chips, does an automatic erase on write, and doesn't have a separate erase instruction. It is also byte orientated (erasing just one byte), rather than having a row architecture.
So, no erase option, since the hardware doesn't offer it.
If you want to clear a location, you just have to write a null value to it. Remember though that it is the erase/write, which uses up a life cycle of the cell....
Best Wishes |
|
|
proyectanteATE
Joined: 02 Feb 2011 Posts: 4
|
|
Posted: Thu Feb 03, 2011 4:36 am |
|
|
Thank you very much for the information!!! |
|
|
|