SPI device needs LSBit First


Author Message
Bowden_P
Senior Member

Joined: 20/03/2019
Location: United Kingdom
Posts: 162
Posted: 12:10am 01 Feb 2023      

Hi John,
While I don't have any experience with the Armmite's SPI interface, I suspect it is very similar to other 'Mites in the family.

I have used the SPI instructions in MMBASIC to communicate between a Micromite Explore 28 or a Micromite Plus Explore 100 and a variety of ADC, DAC, Load Cell, or PIC16F microprocessor chips reliably. While some claim to have an SPI interface, they may be better described as "SPI like" in a lot of cases.

I have found that talking to a Microchip MCP3204 ADC for instance, requires MMBASIC Mode 0 :-

SPI open 30000,0,32                     ' 30KHz, Mode 0, 32 bits.

but for a PIC16F1776 with the SPI peripheral CKE and CKP both = "0", MMBASIC Mode 1 is required :-

SPI open  30000,1,8                     ' 30KHz, Mode 1, 8 bits.


I hope this may help rather than confuse !

With best regards, Paul.