Default SPI0 on Pico interfering with GPIO 7?

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
electronut
Posts: 6
Joined: Mon Dec 13, 2021 3:01 am

Default SPI0 on Pico interfering with GPIO 7?

Post by electronut » Sun Jul 03, 2022 5:05 am

Hello,

I have my SPI0 setup on RP2040 Pico as follows (MicroPython v1.19.1):

Code: Select all

PIN_SS = 17
PIN_MOSI = 19
PIN_MISO = 16
PIN_SCK = 18
PIN_CRST = 7

# init SPI
spi = SPI(0, baudrate=2000000, polarity=0, phase=0, firstbit=SPI.MSB, sck=Pin(PIN_SCK), mosi=Pin(PIN_MOSI), miso=Pin(PIN_MISO))

# set up pins
pin_ss = Pin(PIN_SS, Pin.OUT) 
pin_crst = Pin(PIN_CRST, Pin.OUT) 
The problem is that pin_crst.value() on PIN_CRST has no effect when its value is 7 (GPIO7). Works fine when the it's set to pin 8 (GPIO8).

Is SPI0 somehow interfering with pin 7? Thanks for any insights.

tepalia02
Posts: 99
Joined: Mon Mar 21, 2022 5:13 am

Re: Default SPI0 on Pico interfering with GPIO 7?

Post by tepalia02 » Sun Jul 03, 2022 7:21 am

From the pinout here: https://www.seeedstudio.com/blog/2021/0 ... ries-more/
I can see that GPIO 7 and GPIO 19 both are SPIO Tx. Maybe that's why both are conflicting. Not sure though.

electronut
Posts: 6
Joined: Mon Dec 13, 2021 3:01 am

Re: Default SPI0 on Pico interfering with GPIO 7?

Post by electronut » Sun Jul 03, 2022 8:17 am

I can see that GPIO 7 and GPIO 19 both are SPIO Tx.
Yes, and I am using SPI0 as well. But I would expect that once you set SPI0 to those 16/17/18/19, it should not affect the use of GPIO7.

Post Reply