Integrated Motor Encoder freezing

My robot has 4 IMEs, each of which is daisy-chained in the proper manner. Recently, though, the IMEs have been rather sporadic. Sometimes, though, the LED turns amber and the value freezes. This can sometimes be fixed through a power cycle, but it’s not consistent. I have checked the wiring many, many times, but they seem to be connected properly. We are running the latest firmware and RobotC version. Any help with this problem would be appreciated immensely.

What is the cortex hardware revision (on the base, A3, NC2 etc.) ?

Are these 269 or 393 IMEs ?

Have they worked reliably in the past? Did this change with a firmware update?

Can you fix this by removing and then inserting the I2C cable at the cortex (don’t power off). Moving cables when the cortex is powered is not something I would generally recommend but the latest ROBOTC will reinitialize IMEs if it detects a comms problem so this may help diagnose if it is a cortex or IME issue.

It does sound like a cable issue, do you have any more 4 wire cables you can use to replace the existing ones?

Also, how long are you waiting between loops around to read the I2C data again? (try a longer wait just for kicks)

This is more a question stemming from the initial I2C implementation last year and not the latest version as I have not played with them lately. I would think the serial polling/response of the I2C communication takes a bit to go through 4 sets of sensors. That ARM processor on the Cortex is pretty quick so it is probably waiting for responses most of the time relatively speaking.

So it’s still just a hunch here. I wish I could see the real code controlling the I2C communications to ensure it’s thread safe and not having a thread to barge in the middle of updating things. Or how it handles the reach out to each of the I2C sensors in the daisy chain for its latest results versus other sensors on the “party line”.

I don’t know what version of the Cortex we are using, and the Cortex is buried too deep to take it off to look, but we purchased it in July. Now, the encoders are failing every time we turn on the robot, which does strengthen the wiring theory. Downloading sample code failed to solve the issue, as well. We do not have enough 4-wire cables to switch every one out; I did notice crimping in a couple of the cables, however. Disconnecting and reconnecting the I2C cable does nothing, so does adding delays in our read loops.

EDIT: We moved the motor+encoder onto last year’s robot (without a firmware update) and it works. This makes me think it’s a problem with our Cortex. Is there a place to find earlier firmware versions?

EDIT 2: We downgraded from ROBOTC v3.51 to v3.08 and this seems to work. That took too long…