My workaround is to send a sacrificial delay before the start of my actual timing-critical block, but I am wondering why this would be.
Thanks,
Steve
Code: Select all
from pyb import SPI
spi = SPI(1, SPI.MASTER, baudrate=10000000, polarity=0, phase=1) # ~ 10.50 MHz
data = bytearray(4)
data[1] = 0xa1
data2 = bytearray(4)
data2[1] = 0xa2
data3 = bytearray(4)
data3[1] = 0xa3
data4 = bytearray(4)
data4[1] = 0xa4
DELAY = 1
#pyb.delay(DELAY) # sacrificial delay here
spi.send(data)
pyb.delay(DELAY)
spi.send(data2)
pyb.delay(DELAY)
spi.send(data3)
pyb.delay(DELAY)
spi.send(data4)
pyb.delay(DELAY)