Now that I have an EEPROM programmer and the means to hook one up to a PIC, I want to make use of that to store the color cycle information for a 3 RGB-LED installation. Without reprogramming the PIC itself, the color cycles could be changed by simply changing/reprogramming the EEPROM.
I could use all those 64 kBit for a single program, but that seems like a bit of a waste. Why not allow for several programs to be stored in that memory, and have a button to skip to the next program?
However, that means I will have to create a 'mini file system' on the EEPROM, to keep track of which pogram starts where, and where the current cycle is. I think I'll do it like this:
- The first byte in the EEPROM holds the number of programs on the chip.
This means that there is a maximum of 255 programs -- should be enough, I think.
- The following bytes list the starting adress of a program. So the second byte in the EEPROM lists the starting adress of the first program, the third lists the start of the second program, etc.
- As before, an instruction bit of all zeroes means a 'restart' of the current program.
I will need to keep two additional values in memory:
- The number of programs;
- The number of the current program.
Doesn't sound like it'll be too hard. Perhaps I can write a program that allows for 'point-and-click' color-cycle programming, allowing for individual programs to be saved seperately -- this would allow individual users to exchange programs. The operator can then combine those programs and put them on an EEPROM chip.