I'm working on project at the moment, that in the future - I need to be able to alter numbers stored in lookup tables - whilst the code is actually still running.
It wont be programmed with the Arduino IDE - but rather C or 'pure' C++.
Clearly, I'll need to make a small program on the PC side to allow me to do this - but how is this done, in general? My hardware includes external flash, and some external RAM. I do not believe I can store these tables in onboard flash for this, as the chip must be reset to allow reprogramming of the onboard flash?
There is only one way I can see this would be done, or how I'd explain it simply anyhow - the table is read and interpolated by the MCU from external flash, so new table data could be sent by serial from the PC to the MCU, which in turn updates the external flash. The PC program reads the lookup table as found, displays on then PC, and any changes are in turn sent back when a change is made?
Nick - thanks, this is with a 1284 chip, but the internal EEPROM is far too small still. Some of my tables will be almost 1KB on their own, and there may be around 10 or more of these. (20 x 20 int arrays)
It seems what I could do, is - every time a value changes, so does an arbitrary number 'attached' to this table, and if that number varies from the number last time the MCU looked, it re-reads the table.
The tables are only to be changed an amount that won't cause any chip damage to be done - maybe 1000 times in a week of heavy calibration - and that's only on a few of them...
I suppose a temporary solution would be like the "old school" method of system calibration, using a couple of buttons to select the right table entry, vary it with a pot and click to save.
Am I correct in saying updating internal flash requires a chip reset?
jtw11:
Am I correct in saying updating internal flash requires a chip reset?
Normally the program memory is protected from being changed by the currently-running program. It's not so much that you need a chip reset, it's that you need to enter the bootloader, or reprogram from an external programmer.