SPI and SoftSPI on RPi pico: not 8-bit-clean?
Posted: Sat Nov 06, 2021 11:45 am
Either, I am using the class wrong our I found a bug.
I am running on a RPI Pico, MicroPython version 1.17 (current as of today).
My test code:
The 0x7f comes out as expected: 8 pulses on the clock pin and the data as expected.
The 0x8f comes out as 16 clock pulses and with data I can not make sense of.
I think the SPI should simply transmit the binary data I feed in, right?
I am running on a RPI Pico, MicroPython version 1.17 (current as of today).
My test code:
Code: Select all
from machine import Pin, SPI, SoftSPI
import rp2
import time
_oe = Pin(15, Pin.OUT)
_oe.high()
latch = Pin(14, Pin.OUT)
latch.low()
#s = SPI(1, baudrate=1_000_000, polarity=0, phase=0, sck=Pin(10), mosi=Pin(11), miso=Pin(12))
s = SoftSPI(baudrate=500000, polarity=0, phase=0, bits=8, firstbit=machine.SoftSPI.MSB, sck=Pin(10), mosi=Pin(11), miso=Pin(12))
s.init()
print(s)
s.write('\x7f')
s.write('\x8f')
The 0x8f comes out as 16 clock pulses and with data I can not make sense of.
I think the SPI should simply transmit the binary data I feed in, right?