SPI communication

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

Moderator: Benj

Post Reply
Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times

SPI communication

Post by Emanuel Lourenco »

Hi

I'm trying to use the SPI function with my DSpic33EP256MU806.
I am beginner in electronica, I hope you can help me.
1º What the pins for the use of SPI communication (been to see the datasheet but not meeting the four channels SPI)


Best Regards
Attachments
Untitled.png
(34.63 KiB) Downloaded 2379 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: SPI communication

Post by kersing »

This device uses re-mappable SPI pins (except for channel 2). In the component properties (under the heading "Connections") you can select the pins to you want to use from the available choices. If you do not want to choose, use channel 2, the pins are fixed for that port.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times

Re: SPI communication

Post by Emanuel Lourenco »

Thanks for the reply

I have more questions, if you can help me grateful.
For SPI communication have the pin MOSI, MISO, SCK and CS right?
In the component properties not appear CS pin why?
What is the solution?

Origado

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: SPI communication

Post by kersing »

You can use any output pin for CS. Use an output icon to control it. At the start of main (or in a macro) set the pin to the 'inactive' level. Then just before starting SPI communications set the pin to 'active' level.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times

Re: SPI communication

Post by Emanuel Lourenco »

Thank's

I have a Flowcode file to test. If you have a problem I say something.
Now only a curiosity, what's the difference between master and cal_spi spi?

Best Regards

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 communication

Post by Benj »

Hello,

The CAL_SPI is responsible for all low level SPI functionality.

The SPI Master component has the CAL_SPI component built in but also provides some extra functionality in the form of macros and properties for the SPI E-block EB013 and Console data in the Flowcode simulation.

Emanuel Lourenco
Posts: 63
Joined: Mon Dec 23, 2013 5:51 pm
Been thanked: 8 times

Re: SPI communication

Post by Emanuel Lourenco »

Benj wrote:Hello,

The CAL_SPI is responsible for all low level SPI functionality.

The SPI Master component has the CAL_SPI component built in but also provides some extra functionality in the form of macros and properties for the SPI E-block EB013 and Console data in the Flowcode simulation.
Hello

Can you tell me what are low level SPI? What kind of equipment?

Sorry for all these questions but I'm starting in the world of electronica.

Thanks

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 communication

Post by Benj »

Hello,

By "low level SP"I I mean it provides macros to configure the SPI, send a byte via SPI and receive a byte via SPI, i.e. the physical layer in an OSI model.

http://en.wikipedia.org/wiki/OSI_model

Therefore any SPI based device should work fine with either the CAL_SPI component or the SPI Master component.

Post Reply