> I had a project where I needed predictable timing for I/O (reading a microprocessor’s bus at 1 MHz), and the ESP32 I was using just couldn’t do it reliably. Despite having a tight loop on a dedicated core with interrupts disabled, a loop iteration would sometimes take longer than a microsecond, causing it to miss some I/O. I was able to do it much more reliably with RP2040’s PIO.
You should either:
* have a timer triggering interrupt that reads the data
* have a timer triggering DMA from the input port (if it was whole 8/16 bit) directly to memory
* trigger an interrupt with microprocessor's clock bus and read it directly.
Technically the 2nd one should have zero jitter (aside from clock itself).
Busy loop is the worst case on a microprocessor running RTOS to do the other stuff.