SPI device needs LSBit First

Author Message

Regular Member

Joined: 28/07/2017
Location: Australia
Posts: 78
Posted: 05:44am 25 Jan 2023      

The SPI on MMBasic only supports MSB first (Most significant Bit first).  The chip I am trying to talk to requires LSB first (Least Significant Bit first).  I simply reverse the order of the 8 bits I am writing and reading from the SPI.  But I can not get it to work??  I have never had any issues with the standard MSB SPI comms.  The chip is MODE 0 and 8 bits, so this is not the issue and I ensure SSEL pin goes low during SPI write or read. The chip is most significant byte first so this is not the issue either.

Is there any reason why just reversing the 8 bits in each byte would not work over the MMBasic MSBit SPI to emulate LSBit comms??

Just know enough to get me in trouble, but not quite enough to get me out.