Page 1 of 1

set SPI-master DataMode and BitOrder

Posted: Fri Jul 03, 2020 7:29 am
by rstechnics
Hi, using the SPI master function for programming an Arduino / ATMEGA328P, we would like to setup the SPI mode and Bitorder.
In the SPI Master component found no settings for this, and copying the C-code from a arduino.INO file does not work because of missing SPI.library....

Like to set these 2 parameters:
SPI.setDataMode(SPI_MODE3);// When SCK is high, send/receive data, when idle, set pin to HIGH
SPI.setBitOrder(MSBFIRST);// Transmission from MSB
How can we do that?
Regards, Luuk Aalders

Re: set SPI-master DataMode and BitOrder

Posted: Fri Jul 03, 2020 8:21 am
by LeighM
Hi
The bit order for the SPI Master is MSB first.
The MODE settings are in the Component Properties ...
spi.jpg
spi.jpg (7.81 KiB) Viewed 1586 times

Re: set SPI-master DataMode and BitOrder

Posted: Fri Jul 03, 2020 12:10 pm
by rstechnics
Many thanks LeighM,
with this knowledge now i can cross these settings to the corresponding SPI Modes!
spi-mode.png
spi-mode.png (37.89 KiB) Viewed 1575 times