-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: Use HAT EEPROM chip to store hardware configuration #292
Comments
This proposal hasn't been submitted for review yet, so I haven't reviewed the design document in detail yet - but I did notice one particular question you had added to the "Open issues" section of the design document, and my answer might affect your design:
No, we have no way of retrieving data from the motors about the identity of the motors. For information about what kinds of motors, LEDs, lenses, and flowcell are in the PlanktoScope, and for parameters related to the specific kinds of motors (e.g. microsteps or max speed), each of those values will need to be specified by the person who built the PlanktoScope or by the person who is operating the PlanktoScope. Thus, we will need to persist that information in a |
The PlanktoScope HAT uses this series of EEPROM chips: https://www.st.com/resource/en/datasheet/m24c32-w.pdf . Here are my notes from reviewing the datasheet, which might be useful for troubleshooting the issues you've encountered with trying to write some data to the EEPROM and read it back to get the same values you had written:
Additional questions which might help you with troubleshooting:
|
Since the interface for this EEPROM chip appears to be rather complicated, I would suggest seeing if you can study and learn from any existing code for interfacing with this EEPROM chip. As far as Python projects go, I have found https://github.com/zzts/Python-eeprom, which was tested with the same chip we're using. |
Copying Laurent's direct message to me on Slack:
The I2C device address is separate from the memory address. The datasheet describes the I2C device address as an 8-bit address where the least-significant bit (bit 0) is a read/write bit describing whether the I2C command is for a read operation or a write operation; and the four most significant bits (bits 7, 6, 5, and 4) are 0b1010; and the value of your remaining bits (bits 3, 2, and 1) depends on the voltages of the chip's E3, E2, and E1 pins. In this interpretation of I2C device addresses, the device address should be between 0b10100000 (0xa0) and 0b10101110 (0xaf). I believe the smbus2 library's API assumes that you provide the seven most-significant bits of the device address as the device's address, but shifted right by one position (so that the read/write bit is shifted out of the device address, e.g. 0b10101110/0b10101111 becomes 0b1010111); then the smbus2 library shifts that address left by one position (to make the device address an 8-bit address, e.g. 0b1010111 becomes 0b10101110) and then sets the least-significant bit depending on whether it is sending a read command (e.g. 0b10101111) or a write command (e.g. 0b10101110). In the GitHub repo I linked to above, they called various smbus2 read/write functions with an I2C device address of 0x50 (0b101000), which corresponds to the E3, E2, and E1 pins connected to ground (or left floating). The PlanktoScope HAT schematic shows those pins being connected to ground for us too, so (if I have understood the datasheet and the smbus2 library correctly) we should probably also be using 0x50 as the device address for our EEPROM chip. Is that the address you're using? |
Motivation
Over the years with the modularity and the constant evolution of the Planktoscope hardware configuration we face multiple users with different hardware configurations and bugs that needs to be solved in order to maintain a good community and to keep the Planktoscope modular.
We face the challenge of trying to achieve good results with different machines that can evolve with time.
We would like to retrieve easily the hardware configuration of the machine and that this configuration evolves automatically with the machine.
Proposal
The Planktoscope HAT contains a 32 Kbits EEPROM chip that can store informations.
We propose to use that chip to store the hardware configuration of the machine to fully use the possibilities of the PlanktoScope HAT and be able at anytime to get this configuration to help the debug process.
The text was updated successfully, but these errors were encountered: