set SPI-master DataMode and BitOrder

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
rstechnics
Posts: 16
Joined: Mon Oct 29, 2007 12:17 pm
Has thanked: 2 times
Been thanked: 1 time
Contact:

set SPI-master DataMode and BitOrder

Post 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
kind regards,
Luuk Aalders

RS Technics BV
for electronics engineering and industrial controls
The Netherlands
www.rstechnics.nl

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: set SPI-master DataMode and BitOrder

Post 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 1323 times

rstechnics
Posts: 16
Joined: Mon Oct 29, 2007 12:17 pm
Has thanked: 2 times
Been thanked: 1 time
Contact:

Re: set SPI-master DataMode and BitOrder

Post 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 1312 times
kind regards,
Luuk Aalders

RS Technics BV
for electronics engineering and industrial controls
The Netherlands
www.rstechnics.nl

Post Reply