Closed bawanqin1987 closed 1 month ago
from machine import Pin, SPI import time
spi = SPI(0)
spi = SPI(0, 1000000, polarity=1, phase=0, bits=8, firstbit=SPI.MSB, sck=Pin(2), mosi=Pin(3), miso=Pin(4))
cs = Pin(5, Pin.IN)
time.sleep(2)
cs.value(0)
spi.write(b'\x00') received_data = spi.read(512) cs.value(1) time.sleep(1)
print("Received data:", received_data)
This isn't related to the examples in this repo. You should ask for more help at https://github.com/orgs/micropython/discussions an/or https://forums.raspberrypi.com/viewforum.php?f=146
P.S. I found a comment https://github.com/orgs/micropython/discussions/10442 from January 2023 saying that Micropython doesn't yet support SPI slave mode.
hi sir i wanna code the py case with spi slave mode on PICO2,and the other soc board spi with master mode and send data but pico2 receive data error,all data is 0xff,
and,i catch the signal with my soc board,the signal data as below:
please make sure the py case support spi slave mode?