Refactor the provided I2C Spin routines in order to achieve I2C clock speeds of at least 500 Hz on a Propeller microcontroller.
- The provided Spin software is already tested and running on a Propeller chip
- The max I2C clock speed verified with the provided Spin program is 27 Hz
- The minimum measured frequency at the I2C clock speed line (with an oscilloscope) must be 500 Hz
- There must exist a configuration parameter for limiting the max clock speed of the bus
- The program is limited to using only one cog per device communication
- The routine original interfaces cannot be changed
- All lines of Assembly code must be documented
- More than one instance of the utility may be running on different cogs at the same time
- The utility may permit communications with different devices on the same I2C bus from the same Cog, sequentially
- A Spin program with acceptance test cases must be provided along with the refactored programs
- The utility must run on a Propeller Demo Board in order to perform the following tasks:
- read all onboard EEPROM contents at 500 Hz (I2C clock speed)
- write some bytes to the onboard EEPROM and read them back in order to verify that they are the same
I will give you a 30% bonus if the program can perform I2C clock speeds of at least 1MHz during reading operations.