Which are the SPI pins on Tiny 2040

I am a a bit late with a response, but this may help someone else seeing the same error.

The issue is with the software wanting to use hardware SPI on the RP2040. The first argument to SPI() is the hardware SPI identifier. The code is calling as “SPI(1, …” indicating hardware for SPI1 is to be utilized. Looking at the pin diagram, only SPI0 is available on the selected IO pins. Changing the call to “SPI(0, …” will resolve the bad SCK pin exception.

Try

spi = SPI(0, baudrate=2000000, polarity=0, phase=0, 
        sck=Pin(2), mosi=Pin(3), miso=None)

Enjoy!
Bill

1 Like