Thanks for your suggestion
I tried it and got the same result. It is just a quick cut in Python to write some zeros to pulse the clock line as as it reads and writes at the same time in RPi Python. In the data sheet for the LS7366R it says the chip ignores the MOSI input while writing to MISO, it just needs the clock line to pulse.
Here's my Micropython code and u can see where I have copmment out a few other things that I tried, all had same result. I think that maybe I am using the SPI wrongly??
Code: Select all
from machine import Pin, PWM, SPI
spi2 = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
cs = Pin(15, Pin.OUT)
spi2.write(b'\x20') #clear counter
spi2.write(b'\x30') #clear status
spi2.write(b'\x88\x03') #set MDR0 to 4 counts per cycle
spi2.write(b'\x90\x00') #set MDR1 to 4 byte counter
buf = bytearray(4)
cmd = bytearray((0x64, 0, 0, 0, 0))
#spi2.write(b'\x60') #command to read counter
#data = spi2.read(4) #read 4 bytes