Acquisition
Goal
Turn one exposure of 128 photodiodes into pix[128], with the analog-to-digital step on the ADC.
Design
Pins, from the overlay: AO on P1.11 (AIN4), SI on P1.12, CLK on P1.08. READOUT_HW is 1. TIMER21 and GPIOTE make CLK. SI is a CPU pulse, high only across rising edge 1. The falling edge triggers an SAADC sample through DPPI, and EasyDMA writes the buffer in pixel order. TIMER22 stops the burst on rising edge 129. Pixel clock is 125 kHz. The flush clock is 4 MHz. Acquisition is 2 us. The CPU must not bit-bang CLK, and it must not send Bluetooth from inside the readout. Pixels 0 through 3 are copies of pixel 4. The hardware path programs the SAADC directly and hardcodes AO as P1.11. The overlay channel is only used if READOUT_HW is 0. This readout has not been run on this board.
Challenges
- The J-Link is power, programming, and the text log. Unplugging it removes all three.
- A blocking RTT print will stall the scanner when no debugger is reading, and the BLE image still prints every line.
- If the log stops after the readout line, the board may have no 32.768 kHz crystal. The BLE config would then have to use the internal RC. That has not been tried here.
Iterations
- Bench photo: breadboard, sensor note, J-Link on the left.
- Hardware-timed readout written, with a dark frame and a 25 ms loop.
- Not run on this board. There is no build output in the tree.
Final implementation
The source describes a 128-value scan. I am not calling that scan done. The finger-test figure is an earlier check, with no lens: 128 pixels on the vertical axis, time on the horizontal.










