2

I had an adapter board made for a Raspberry Pi 4B and I somehow swapped the SPI clock and data lines on the board. Rather than redrawing and waiting for new adapter boards, is there a way to reassign which GPIO pins connect to the data and clock pins on the SPI bus - I am using Python to control an SPI OLED display so any suggestion of Python code or HW config would be great.

Specifically,

the default SPI0 SCK is is header pin 23 - I'd like to assign it to header pin 19.

The default SPI0 MOSI is header pin 19 - I'd like to assign it to header pin 23.

Any help is appreciated even if it is, "hey, that's not possible, etch a new board".

Thanks.

2

You can't reassign the hardware functions of those GPIO.

You will have to physically swap the wiring.

If your application is low speed you could consider bit banging SPI in software. That would allow you to use any pin for any purpose (albeit with a large performance hit).

1
  • Sorry, I apparently need 15 reputation points before I can give up-votes. But, +1 to you. Thank you. Sep 5 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.