Skip to the content.

E17 — V5F as a live DVP data checker

   
ID E17
Date 2026-12-02
Status done
Decisions D95, D97 (DECISIONS.md)
Board #1 (rev A), RP PIO counter → capture switch → CH32 DVP, 10-bit, PCLK up to 75 MHz
Firmware + results fw/tests/2026-12-02-12-ramloops-v5f-156mhz (sources, binaries, results.txt)
Scripts dvpv5f.py

Summary: The V5F checks every sample of a 75 MS/s DVP stream while the V3F only re-arms (64–72 % V5F load, 0 bad samples, a broken stream is caught); a V5F loop that only reads shared RAM locks the V3F out completely.

What

First real job for the second core (E13). The V3F streams the DVP into a 64 K-sample ring (16–4096 slots) and counts chunks in the shared-RAM mailbox; the V5F (mailbox command 5, code in flash through its I-cache) follows the count and checks that every sample is the previous + 1 (mod 1024), reporting bad samples, lag and overruns.

Results

Every sample checked (dvpv5f, 2 s at 75 MS/s = 150 M samples; V5F load = time spent checking / stream time):

chunk 96 MHz V3F / 384 MHz V5F 156 MHz V3F / 312 MHz V5F
4096 0 bad, 64.0 % 0 bad, 44.2 %
1024 0 bad, 65.2 % 0 bad, 45.0 %
256 0 bad, 68.0 % 0 bad, 47.8 %
128 0 bad, 71.8 % 0 bad, 51.5 %
64 212 bad (V3F re-arm late), 79.4 % 0 bad, 59.1 %
1024 at 37.5 / 10 MS/s 31.1 / 8.0 % 21.9 / 5.7 %
control: 16 at 75 MHz (re-arm too slow) 5.6 M bad samples caught 3.8 M caught

Lesson

Give every polling loop on a second core a pause: a tight loop of loads on one shared-RAM word starved the other core until reset, and it looked like a firmware hang. A minimal debug command (start and stop the checker with no data) found it in one step.

Chip facts and numbers: fw/LEARNINGS.md. All experiments: index.