Hi
In my current project, I am planning on using an SPI EEPROM with an arduino. I am looking to use the CAT25256 EEPROM. It seems well documented, reliable, affordable, and is avaliable in 64k, 128k, 256k, and 512k sizes. This is important because I will want to reuse this code in future endeavors.
Anyways, I am currently trying to decide on how to store/arrange my data. I am building a system with 256 presets (0-255). I figured it would be easy to store each preset in a 64 byte page on the EEPROM, since, if I understand correctly, every time you write to the EEPROM, you must write the entire 64 byte page. Is this correct? Or does an EEPROM just need a memory write address and page write is a separate feature?
Each preset will be storing the output state of 16 relays, and the associated present number in an array. I think the data structure for this will take up 3 bytes. 1 byte for assigned the channel number, and 2 bytes for all 16 relay states (Ie. 01010101 01010101 Channel 0 = off Channel 1 = on Channel 3 = off etc). I am planning on defining the memory location of each array in the eeprom, so data doesnt get lost. In addition, for each channel I would like to store assorted MIDI commands. To start, I will be sending MIDI beat clock, and program change commands. These are a maximum of 3 bytes each. However, I am not sure how to organize this as part of the data structure. Each preset I am thinking will be able to send 8 midi commands (More then I am ever likely to need). Would it make sense to just allocate 24 bytes at the end of every array and if no midi commands are present just set all the values to 0? Then each midi command is written in sequentially for recall?
Thank you for reading this and providing feedback, this is my first experience with EEPROM's, so I hope I am not messing up any of the fundamental concepts!