View previous topic :: View next topic |
Author |
Message |
championx
Joined: 28 Feb 2006 Posts: 151
|
PIC24E and write_program_memory |
Posted: Fri Aug 29, 2014 12:46 pm |
|
|
Hi, im trying to use the function write_program_memory in a 24EP512GP806. But it seems that it doesnt make anything.
I have used this function on other pic16 and pic18, but never on this one.
Code: | for(address_erase=0;address_erase<0x557ff;address_erase+=(getenv("FLASH_ERASE_SIZE")/2))
{
write_program_memory(address_erase, data, 16);
} |
This should "destroy" the pic program... but it doesnt do anything... the pic keeps running normally.
Is there anything that im missing? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Fri Aug 29, 2014 1:07 pm |
|
|
Obvious first thing, fuses?.
Second compiler version?.
Then the memory organisation is very different. Each word, is programmed as 32bits, but only holds 24bits. So you have three bytes holding data, then missing byte, then the next three etc..
The page is 1024bytes long, holding 768 bytes of useable data. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 29, 2014 7:44 pm |
|
|
The OP said in a PM that he solved the problem by upgrading from
compiler vs. 5.008 to 5.026. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Fri Aug 29, 2014 11:43 pm |
|
|
As I said, 'compiler version'?.
5.008, is very much a 'beta' version, so not surprised.... |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Fri Aug 29, 2014 11:49 pm |
|
|
Ttelmah wrote: | Obvious first thing, fuses?.
Second compiler version?.
Then the memory organisation is very different. Each word, is programmed as 32bits, but only holds 24bits. So you have three bytes holding data, then missing byte, then the next three etc..
The page is 1024bytes long, holding 768 bytes of useable data. |
The "...("FLASH_ERASE_SIZE")/2" does not look right at all for this class of PIC. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Sat Aug 30, 2014 12:35 am |
|
|
Agreed, but it would still give the 'crash' expected from this code.... |
|
|
|