Popular Post dycus Posted August 9, 2023 Popular Post Share Posted August 9, 2023 (edited) I was doing some testing with an old green MTen3 board and checked the communications between the microcontroller and the IMU (gyroscope/accelerometer chip). The IMU is an MPU-6050, and the microcontroller is talking to it over I2C (a type of chip-to-chip communication protocol). The problem is that the IMU is designed to only communicate at a maximum clock speed of 400kHz, however, Begode's firmware talks to it at 960kHz, 2.4x the specification! What does this mean in a practical sense? Clearly it still works, right? Yes, it is currently working, but the chip manufacturer only guarantees it will always work within specified operating parameters, and Begode is running the chip well outside that range. It could stop working properly for many reasons, such as if the chip gets too warm or if its supply voltage droops a little, even though the temperature and voltage could still be in the valid operating range. Talking to the IMU too quickly means that the data it returns could be incorrect or corrupted. This could cause the EUC to think it was tilted too far and activate the angle shutoff, or think that it's not level and accelerate or decelerate when it shouldn't. It's impossible to know if this has ever caused a cutout, but I was certainly shocked with I saw this. It's a super bad idea. I wonder if newer Begode firmware also has this bad behavior. Edited August 9, 2023 by dycus 3 1 4 Quote Link to comment Share on other sites More sharing options...
sbb Posted August 10, 2023 Share Posted August 10, 2023 You're talking about the clock rate of the serial bus, yes? Great catch. Yeah, pretty bad idea, but they probably get away with it because the output driver is just clocking out a shift register with ns setup times, and the distance isn't very far. We used to overclock UARTs all the time back in the day, if errors could be caught. Basically it'll work until a cat hair changes the capacitance or impedance of that SDA line, then their line sampling will magically not work anymore. Then, as we used to say, "Hilarity ensues." 1 Quote Link to comment Share on other sites More sharing options...
dycus Posted August 10, 2023 Author Share Posted August 10, 2023 Yeah, the I2C clock rate. And you are right, it's probably not as bad as it seems for a couple reasons: 1. As you say, most I2C peripherals output data with essentially a shift register, which is very fast 2. This chip only supports I2C, but it has an alternate part number that also supports SPI (over the same pins, just depends on how the chip select pin is configured), and the SPI supports 1MHz. Many chips that support SPI and I2C in this way likely use the same circuitry internally to output the data in both instances It's possible Invensense just didn't want to go through the effort of officially supporting I2C Fast Mode Plus (1MHz) so just implemented Fast Mode (400Khz). Still, it definitely sketches me out! And the actual SDA/SCL lines have perfectly fine rise times, I checked with a scope. It's just the data rate that's too high. 1 Quote Link to comment Share on other sites More sharing options...
alcatraz Posted August 11, 2023 Share Posted August 11, 2023 Excellent finding. Thank you for sharing! Quote Link to comment Share on other sites More sharing options...
RagingGrandpa Posted August 14, 2023 Share Posted August 14, 2023 But we have thousands of miles of history on MTen3 to look back on now... I think it has a reliable reputation? Specsheets be damned! Quote Link to comment Share on other sites More sharing options...
alcatraz Posted August 15, 2023 Share Posted August 15, 2023 Evidently, not all out-of-spec uses end in failure. It's great to know though. This is pure speculation but maybe the manufacturer has multiple model chips but under the label it's the same chip. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.