Closed endail closed 2 years ago
After increasing the PIO state machine frequency from 1MHz to 10MHz, the HX711 is still performing well and readings are very stable.
Removing the T3 delays does not seem to have any effect. However, I am reluctant to remove them because they are the bare minimum according to the datasheet and low-quality HX711 ICs/boards may not have the same performance.
T2 is still unneeded due to the delays in reading the data pin and jump instructions.
T4 also unneeded for the same reason as T2.
T1 is a little more complicated.
RP2040 datasheet states:
With no delay following wait
(ie. wait 0 pin 0 [1]
), and assuming the next instruction executes immediately after the wait condition is met, the clock pin will go high following that second instruction (ie. set pins, 1 [T3 - 1]
). The set pins, 1
portion of the instruction will take one cycle, which at 10MHz is 100ns (0.1us), which is the absolute minimum for T1 anyway.
Conclusion? T1 is also unneeded.
PIO program documentation also needs an update to reflect these changes.
Experiment with delaying and reading at the absolute minimum rates possible. Currently resolution is at 1us.