I am currently waiting on parts, so I don't have any code yet. The goal of my project it to program EEPROM of an arduino with a separate arduino. In this case the "master" is an Uno and the slave is the Adafruit Macropad. The macropad has 12 keys, an OLED display, a rotary encoder all with an I2C connector. For those concerned, I will be using a logic level converter as the Uno is 5V logic and the Macropad is 3.3V. Upon setup() the Uno will look to see if the Macropad is connected. If it is connected, it will enter into "programmer mode" that will allow the user to program into the uno the proper EEPROM bytes.
Inside "programmer mode", I would like the uno to request from the Macropad the proper byte setting for EEPROM_block1. I envision this would look like:
-
Uno-->Macropad: Current EEPROM_block1 read is #. Requests an input for EEPROM_block1, acceptable range includes min_number_block1 to max_number_block2.
-
Macropad: User types in a number on the macropad and presses send.
-
Macropad-->Uno: The number between min_number_block1 to max_number_block2 is sent to the Uno.
-
Uno: writes the received number in EEPROM_block1. It then reads EEPROM_block1 to verify proper write.
-
Uno-->Macropad: Sends the EEPROM _block1 data to confirm
-
Then loop 1-5 on EEPROM_block2 to EEPROM_blockN.
I anticipate approximately 10 bytes to program. Some of the writes may exceed 1 byte and therefore would include multiple bits.
My question is this: Does the Uno stay the master and the macropad the slave, or are they reversing roles multiple times between each EEPROM_block writes?