It is a known fact that ESP32 is too fast for the crappy HX711.
Is this the case for ADS1232 as well ?
(spoiler: yes, but not so much)
I wrote a simplistic explanation, aimed at noobs like me showing the problem with charts/screenshots.
Excel with some charts is here
Too much reading ? No worries, I got you:
Please note that HX711 is much worse than ADS1232, that’s why we are barely OK with 112ns here but waaay out of spec for HX711.
SCLK min pulse width for the ADS1232 is 0.1us (100ns) and 0.2us(200ns) for the HX711.
But still, the final quick pulse we do to force the DOUT HIGH (optional) is within specs (112ns/112ns > 100ns)
So, we should not have an issue with those pulses (barely). We don’t need to worry about inserting delay before and during the pulse.
Most of the times, the DOUT change is done within 20-30ns from the HIGH command, 10-20ns from the clock going HIGH. In extreme cases, I’ve seen 40ns and the datasheet says max 50ns. If our MCU tries to read the DOUT within this period, we will (possibly) have an error bit. And depending on where this bit is, the error impact might be huge
I am not exactly sure if t3 or t4 (or both) is the issue. 112 is very close to 100ns, but still within specs. On the other hand, I cannot measure the time from SCLK HIGH to digitalRead command to verify that it always is >50ns.
Frequency | Delay(+) | Delay(-) | Width (+) | Width (-) | Total Read | |
240MHz | 0 | 0 | 260ns | 125ns | 9.40us | ERRORS |
240MHz | 1 | 0 | 1.9us | 112ns | 51us | |
240MHz | 1 | 1 | 1.9us | 1.9us | 97us | |
160MHz | 0 | 0 | 375ns | 187ns | 13.66us | |
160MHz | 1 | 0 | 2.73us | 175ns | 72us | |
160MHz | 1 | 1 | 2.71us | 2.52us | 133us | |
80MHz | 0 | 0 | 738ns | 362ns | 26.7us | |
80MHz | 1 | 1 | 5.14us | 4.79us | 243us |
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.