Repository navigation
I2C input filter threshold and ModuleDisplay on CoreMatrix (ESP32-C61) - #414
Merged
lovyan03 merged 2 commits intoNov 11, 2026
Merged
Conversation
The hardware I2C enabled the SCL / SDA input filters with a threshold of 0 cycles. On ESP32-C61, with a device whose ACK only reaches about half of VDD (a module behind series resistors and a level shifter), the controller detected a STOP right after the ACK and left the command list: it kept clocking with SDA high until the stall timeout, and the device received 0xFF bytes. Initialization of that device failed on every power-on; with the filter threshold set, it no longer did. Set the threshold to 1/16 of the bit period, up to the maximum of 15 source clock cycles (with a 40 MHz source clock: 15 at 100 kHz, 6 at 400 kHz). The filter delay can lengthen the SCL high time when it approaches the SCL wait-high period: on ESP32-C61 at a 400 kHz setting the bus ran at about 435 kHz with a threshold of 0, 418 kHz with 6 and 382 kHz with 15; 100 kHz was unchanged on that bus. The filter is still disabled for short periods as before. ESP-IDF also enables a threshold on these chips. ESP32 and ESP32-S2, which use a different filter register, are unchanged.
Enable M5ModuleDisplay on ESP32-C61 with the CoreMatrix M-Bus wiring (I2C port 0 on G0 / G1, SPI2 with CS G22, MOSI G27, MISO G26, SCLK G25), and use the write-only transmitter path, since register reads from the transmitter fail on CoreMatrix. CoreMatrix is the only ESP32-C61 host with an M-Bus, so the wiring does not depend on board detection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two commits:
On ESP32-C61, with ModuleDisplay on CoreMatrix (the transmitter's ACK only reaches about half of VDD), the controller detected a STOP right after the ACK and left the command list: it kept clocking with SDA high until the stall timeout, and the device received 0xFF bytes. Initialization of that device failed on every power-on. With the threshold set, the stalls no longer occurred.
The threshold is 1/16 of the bit period, up to the maximum of 15 source clock cycles (with a 40 MHz source clock: 15 at 100 kHz, 6 at 400 kHz). The filter stays disabled for bit periods of 64 source clock cycles or less, as it was. ESP32 and ESP32-S2 use a different filter register and are unchanged. ESP-IDF also sets a threshold on these chips.
2. Support ModuleDisplay on CoreMatrix (ESP32-C61): enable
M5ModuleDisplayon ESP32-C61 with the CoreMatrix M-Bus wiring (I2C port 0 on G0 / G1, SPI2 with CS G22, MOSI G27, MISO G26, SCLK G25) and use the write-only transmitter path, since register reads from the transmitter fail on CoreMatrix. CoreMatrix is the only ESP32-C61 host with an M-Bus, so the wiring does not depend on board detection. M5Unified sets it up inM5.begin()with a separate PR.Bus speed
The filter delay can lengthen the SCL high time when it approaches the SCL wait-high period. Measured on ESP32-C61 (logic analyzer, address byte time):
Testing