I'm working on an ATMEGA16 data collection project where I need to sample a lot of data for a long time. The 16 has 16k of flash. This is plenty of room for my data, but I don't know how to write to the flash, and I'm not sure it can be written to during a program run.
Can someone give me an explanation of how flash is programmed? A code example would be great. And what is it generally used for?