SPI-example
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: SPI-example
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
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