So. If you should find that the code runs from the debugger, but does not start on its own when you plug in the usb, add to your rootmost CMakeLists.txt set(PICO_BOARD pico_pair) referencing pico-sdk/src/boards/include/boards/pico_pair.h and if you don't have that file, just copy pico-sdk/src/boards/include/boards/pico.h but add these three lines near the top, after the name … Continue reading Raspberry Pico fail to boot from flash
Electronics
General PCBA notes
Often specifically about JLCPCB and KiCAD. If a crystal says 20pF, it probably actually wants caps of 35pF each. C = 2L-5pF, or so. Then pick an available capacitor near that value. JLCPCB's understanding of 45* rotated components is 90* off of KiCAD's, in some way. ...But only on the pcb bottom? Expect also disagreements … Continue reading General PCBA notes
Crystal oscillator capacitors
Apparently a crystal oscillator marked "20pF" DOESN'T get 20pF caps, it gets ~35pF caps. (In the usual microcontroller's oscillator configuration, anyway.) My rule of thumb, now, is C=2L-5pF. See https://electronics.stackexchange.com/a/677202/166296 .
Raspberry Pico GPIO latency
Fyi. Writing Pico PIO code. A read from a GPIO takes...3.5 clock cycles. I think. (Plz no sue.) I tested several wildly different clock speeds. You can do INPUT_SYNC_BYPASS with `hw_set_bits(&PIO->input_sync_bypass, 1u << PIN);` and it goes down to like 1.1 cycles, but the docs warn the PIO could summon nasal demons if it reads … Continue reading Raspberry Pico GPIO latency