Closed
Description
Using a MPU9250 as my I2c test device I tested using SCL/SDA and SCL1/SDA1. Seems as though i2c clock speed is hardcoded someplace.
SCL/SDA - i2c2
In the overlay default clock is set to fast or 400khz
Setting the clock to 100Khz using setClock(100000) or setClock(i2c_standard) shows an actual clock of 400khz
Setting it 400khz shows same clock
SCL1/SDA1 - i2c4
No default clock is set and seeing 400khz when I do a setclock of 100khz.
EDIT> finally poked around a bit and appears setclock may not be implemented at least I can not find where?
Activity
mjs513 commentedon Dec 26, 2024
To resolve the setClock issue I implemented this piece of code for set Clock in wire.cpp
also had to add this to llext_exports.c
seems to be working for 100khz and 400khz. Tried 1Mhz but my LA read 111khz?? Tested on Wire and Wire1 with the following sketch:
[-]setClock does not appear to do anything on the Arduino Giga[/-][+]I2C setClock does not appear to do anything on the Arduino Giga[/+][-]I2C setClock does not appear to do anything on the Arduino Giga[/-][+]GIGA: I2C setClock does not appear to do anything[/+]facchinm commentedon Jan 8, 2025
Hi Mike, thanks for the investigation! Can I ask you to prepare a PR for the
setClock
implementation? As usual, to preserve proper attribution 🙂 Thank you!mjs513 commentedon Jan 8, 2025
Done. If you want to close not an issue