SPI-example

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

Moderators: Benj, Mods

Post Reply
ri_wo
Posts: 2
Joined: Wed Dec 16, 2009 3:35 pm
Contact:

SPI-example

Post by ri_wo »

Is there an example "how to use the SPI-macro"?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: SPI-example

Post by Benj »

Hello

SPI should be fairly straight forward, Are you using your own SPI device or the SPI E-Block?

Basically the SPI component will need to be initalised and this will let the Flowcode component take hold of the SPI pins. These are labelled as SCK, SDO and SDI on the chip window.

SCK - Serial Clock
SDO - Microcontroller data out / SPI device data in
SDI - Microcontroller data in / SPI device data out

You will also need to provide a CS signal if you are handling your own SPI device. This can be done by simply outputting a 0 or a 1 to a single pin using an output icon.

A simple SPI transaction might consist of the following though you will have to refer to your device datasheet for exact communication protocols.

clear CS line - Enable the device
send byte - the internal address including W/R bit
send byte - the data to be saved at said address
set CS line - Disable the device

More help can be found in the component help file.

ri_wo
Posts: 2
Joined: Wed Dec 16, 2009 3:35 pm
Contact:

Re: SPI-example

Post by ri_wo »

Hello Ben,

Sorry, I was a long time away.
I just restarted my project for communication with a speachchip ISD4002.
So I don't use the SPI E-block.

I can't work with the SPI-macro.
The problem is to place some characters in de "Caracters sent-screen" of the simulatecomponent.

Can you please help me with an example?

Thanx,
Rien

Post Reply