Spi simulation on data scope help

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

Moderator: Benj

Post Reply
User avatar
outlawstc
Posts: 32
Joined: Tue Oct 15, 2013 6:14 pm
Has thanked: 12 times
Been thanked: 9 times
Contact:

Spi simulation on data scope help

Post by outlawstc »

Trying to get spi component to show up on the data scope..
Data scope loads the channels when the spi component is added to the system panel..
But for some odd reason the data scope does not simulate the data being transmitted..
im only trying to transmit info not recieive in response
Any help would be great.
Thanks
"If your having code problems I feel bad for you son... I got 99 problems but a glitch ain't one"

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 simulation on data scope help

Post by Benj »

Hello,

The SPI is driven using the hardware SPI channel or using the software CAL routines. Outputting signals to the scope as part of simulation could be done but the timings might not be very accurate so we have not decided to do this yet.

We have added the SPI channels to the scope window automatically as this helps with using the new Ghost ICT feature on the EB006 which would allow you to see the signals as they are happening on the hardware.

User avatar
outlawstc
Posts: 32
Joined: Tue Oct 15, 2013 6:14 pm
Has thanked: 12 times
Been thanked: 9 times
Contact:

Re: Spi simulation on data scope help

Post by outlawstc »

Oh ok gotcha.
On a side note i spent a while yesterday trying to get the SPI to work on the arduino uno..
For some odd reason when you have it set to a CH it does not work. but when you set it to software it does..
Isnt CH setting preset choices for the pins used to match the pins that the micro controller has SPI built in on..
While software setting is using extra programming on the chip to set up other non built in SPI pins to work as another SPI channel?

Whats the difference in Channel 1 and software??

Thanks
"If your having code problems I feel bad for you son... I got 99 problems but a glitch ain't one"

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 simulation on data scope help

Post by Benj »

Hello,

Channel 1 relates to the on board SPI peripheral and associated pins. The software mode uses a software bit bang routine to manually perform the SPI protocol on any I/O pins.

As your using an AVR there is an issue with the hardware SPI CS pin. If the pin is configured as an input (default) and read as low then it triggers the SPI slave functionality and can lock the processor from performing the SPI master routines. If you output a logic 0 or 1 to the hardware CS pin before you initialise the SPI component or tie the pin high with a pull up resistor then it should get rid of the problem.

User avatar
outlawstc
Posts: 32
Joined: Tue Oct 15, 2013 6:14 pm
Has thanked: 12 times
Been thanked: 9 times
Contact:

Re: Spi simulation on data scope help

Post by outlawstc »

Ben,

I tried what you said and it worked with getting channel one operable

Another thing I think i should mention is for some reason one of the settings for spi seems backwards

the clock phase trailing and leading edge selection..

when you set it to leading edge it writes binary on the falling edge when you set it to trailing edge it writes binary on the leading edge of the clock..

i would think clock phase leading edge should write the 1 or 0 state on the rising pulse of the clock.. am i understanding this wrong or does the flowcode software have a bug?

Thanks
"If your having code problems I feel bad for you son... I got 99 problems but a glitch ain't one"

Post Reply