diff --git a/rpi_spi/2023-12-29_pi-spi-rates.md b/rpi_spi/2023-12-29_pi-spi-rates.md new file mode 100644 index 0000000000000000000000000000000000000000..642d6449dfcd817e8870b5bf70902096d0be1c62 --- /dev/null +++ b/rpi_spi/2023-12-29_pi-spi-rates.md @@ -0,0 +1,10 @@ +## 2023 12 29 + +OK, SPI is looking pretty good; actual bit times are identical to what-they-should-be, so I'm not even going to note them down (whereas UART out of the PI has some drift, probably strange BAUD fractional maths). + +So, there's just the question of waveform integrity, and (probably) the ability of the RP2040 to keep up, and there's the actually-delineating-and-echoing-etc test. + +I'd like to look at some scope traces first, but I should probably do it in context (i.e. actually driving a pin, not free air), so I'll setup my little test rig... + +- female-to-male, +- usb-to-image-capture-on-the-scope ? \ No newline at end of file diff --git a/rpi_spi/code/pi_spi.py b/rpi_spi/code/pi_spi.py new file mode 100644 index 0000000000000000000000000000000000000000..fb90f52c00cc3c50a856c14c570ffcc6870ffc44 --- /dev/null +++ b/rpi_spi/code/pi_spi.py @@ -0,0 +1,10 @@ +import spidev + +spi = spidev.SpiDev() +spi.open(0, 0) +spi.max_speed_hz = 12000000 + +for i in range(100000): + spi.xfer([12, 14, 95]) + +spi.close() \ No newline at end of file