cbarberis
Joined: 01 Oct 2003 Posts: 172 Location: Punta Gorda, Florida USA
|
Problem writing to dsPic program memory |
Posted: Tue Aug 03, 2010 10:01 am |
|
|
Help!!
For some reason I am unable to write to flash program memory and consequently read such. I am using the latest version of the PCD compiler (V4.109) and using a dsPIC33FJ12GP202. Based on the compiler manual I tried doing as shown. But it appears that I am not writing to the memory location as I always read 0xFFFF from the location that I supposedly wrote to. Also when I look at the program memory I do not see what I wrote.
I am sure that there is something very obvious that I am missing here. As usual any help is appreciated.
Code: |
#define PWDELAYVAL 0x001000 // this is the memory location that I am storing to
unsigned int16 bytecount = 4;
unsigned int16 PW_delay ;
write_program_memory(PWDELAYVAL, &PW_delay, bytecount); // this is what I use to write
read_program_memory(PWDELAYVAL, &PW_delay, bytecount); // and this is what I use to read it |
|
|