3
\$\begingroup\$

My device is the dsPIC33EP64MC202. I have a bootloader which loads a program in flash to run or erases and rewrites that program as directed by serial commands. If possible, I would like to account for the possibility of changing the shared configuration bytes in the future, but it seems that might be impossible without a physical programmer.

From DS70618C (dsPIC33E/PIC24E Family Reference Manual), Section 30 (Device Configuration), 30.2.1.1:

Erasing the last page of program memory will automatically enable code protection, which prevents further reads or writes to program memory. As a result, it is not recommended to perform a page erase on the last page of memory where the Configuration bits are stored.

Given that erasing the page with the configuration words triggers code protection, how do I change the configuration bytes in my bootloader? I have tested erasing that page and writing new values to 0xAFF0 - 0xAFFA. Sure enough, only the original, unmodified values are there (before and after reset).

\$\endgroup\$
  • 3
    \$\begingroup\$ I'm not a 16 bit PIC expert, but I'm pretty sure this is one of those things you just can't do. \$\endgroup\$ – Matt Young Apr 14 '14 at 14:27
0
\$\begingroup\$

I did a bit more digging on the site, and this answer for PIC16 makes me think I can't write configuration bytes for dsPIC33E in a bootloader at runtime.

\$\endgroup\$
0
\$\begingroup\$

If you change the config bits you must do a RESET of the device. The config bits' values are copied to internal registers (not visible to the user) every time the device is reset.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.