Page 1 of 1

Default SPI0 on Pico interfering with GPIO 7?

Posted: Sun Jul 03, 2022 5:05 am
by electronut
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.

Re: Default SPI0 on Pico interfering with GPIO 7?

Posted: Sun Jul 03, 2022 7:21 am
by tepalia02
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.

Re: Default SPI0 on Pico interfering with GPIO 7?

Posted: Sun Jul 03, 2022 8:17 am
by electronut
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.