2 ms·
eh, Arduino the library may be too slow, but underlying chip, atmega328, is definitely not. It runs at 16MHz, and most instructions are 1 cycle long (things lik
by theamk 5y ago
eh, Arduino the library may be too slow, but underlying chip, atmega328, is definitely not. It runs at 16MHz, and most instructions are 1 cycle long (things like jumps are 2).
> Strobe pulse is 5us wide (200Khz) so for reliable sniffing I should read I/O ports at 1Mhz. The best I could do was reading necessary 13 channels at 80Khz.
You don't need general protocol decoder, you need to wait for strobe and capture a byte. And you don't need all 13 lines - most firmwares use same byte sequence for each frame, so you can detect frame start and just count the bytes. A main loop may do:
- Wait for frame start
- Capture a frame worth of data - this is 8192 pixels, which is 1024 bytes, which is a half of total RAM
- Slowly send data over serial.. You will miss a couple of video frames, but this is OK, the picture is mostly static.
And you don't even need assembly - the strobe is 80 cycles long, and it looks data comes every 100uS or so - that's 1500+ cycles! Super slow, even inefficient C program can handle it.