[sdiy] a provoking question about time
mskala at northcoastsynthesis.com
mskala at northcoastsynthesis.com
Fri Jun 24 14:50:38 CEST 2022
On Thu, 23 Jun 2022, Roman Sowa wrote:
> I've seen corrupted memory in products made about 15 years ago with dsPIC, so
> datasheet value seems real.
>
> One way to do it is to rewrite all memory from time to time, but how to do
> that? Even if there's real time clock running, the user may always change the
The last page of flash program memory on the PIC24F parts I'm using cannot
be rewritten under program control because it contains the configuration
"fuse" settings. Erase it as a first step in rewriting it, and you've
bricked the part. The only safe way to program it is through in-circuit
programming with a separate programming device, not practical to implement
as part of a product. So one basically just has to accept that the
lifetime of data in that page, and therefore of the part because that data
is essential for boot-up, will be the lifetime of the initial programming.
Now, my understanding is that the configuration "fuses" are read to
separate registers upon boot-up rather than being used directly from
program memory. So it seems plausible that maybe one could erase the last
page, have the microcontroller continue running, and then rewrite the page
and it would be okay, provided the entire operation happened without any
interruption of power. But I haven't attempted that and it's certainly
not authorized by Microchip - their docs say never try to rewrite the last
page under program control at all. It would be very fragile with respect
to to any power interruption during the attempt.
--
Matthew Skala
North Coast Synthesis Ltd.
More information about the Synth-diy
mailing list