(my apologies, as I started a similar thread over a year ago, but I can’t seem to find it now).
Summary: I really need use a function to write to a small flash area pragmatically, while in run mode… even just one small block of flash.
Here’s the issue. I have a WIXEL application which has 8 user accessible momentary contact buttons, along with 4 DIP switches inside my mounting case. I had hoped the 4 switches would be enough for some programming options, but its not enough… I need some more. They will have to change often, so I don’t want an end user to have to resort to re-loading the program with new settings for variables. So for now, I’ve set up the programming to detect certain button combinations when the unit is first turned on, through which the user can then alter some program behavior. The problem, of course, is that the user will have to repeat this process every time he/she turns the unit on. It would be so much better if after the user got through with the custom programming, they could press what i would call a “save” button.
I know could get myself a small I2C flash memory chip to store some variables. But PC boards have already been cut, and so I’d like to solve this pragmatically with the current version of this device if at all possible. The the best way I can think of is if some function could be created to read or write flash. Surely there must be some safe area, or at least an area that would be safe for a given application. And when you consider that even 16 bytes is the equivalent of 128 DIP switches, its obvious that just a single block of flash would be more than adequate.
I hope someone can help with this, and I’m more than sure it could benefit a lot of people’s applications. Surely in the boot loader Pololu has designed, there is an algorithm for writing the flash during program load. I know the boot loader itself is proprietary, but surely the code for that one bit of functionality could be made available for this purpose? I understand the risks, and would not hold Pololu responsible if I clobbered a Wixel by overwriting something important. Please help me do this.
Thanks in advance.