Error in the SPI interface

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

Moderator: Benj

Pascal_2016
Posts: 87
Joined: Wed Aug 31, 2016 4:48 pm
Been thanked: 4 times
Contact:

Error in the SPI interface

Postby Pascal_2016 » Thu Aug 22, 2019 10:39 pm

Hello,

I wanted to set up a SPI communication with a panel. Unfortunately I didn't succeed because the program comes to an end when the SPI interface is initialized.

- I use an Arduino Uno Board.
- Every 500ms the Arduino LED (Digital 13) is controlled.
- Before the endless loop the SPI interface is initialized.
- No further SPI activities to follow

If the SPI interface is deactivated - SPI is not initialized -, the program runs without objection. the LED flashes in the preset frequency. If I activate the SPI interface, the program gets stuck with this expression.

Can anyone help me?

Translated with www.DeepL.com/Translator
Attachments
Flowcode5.fcfx
(8.29 KiB) Downloaded 35 times

EtsDriver
Valued Contributor
Valued Contributor
Posts: 437
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 348 times
Been thanked: 228 times
Contact:

Re: Error in the SPI interface

Postby EtsDriver » Fri Aug 23, 2019 8:33 am

Hi!

Are you 100% sure the SPI bus is working and you are addressing right device?
On FC7 i remeber the ENC ethenet module had habit to stuck the program when trying to initialize the module, when it was not present...
Could this be same thing?

Have you tested that the display works?
Ill just keep the good work up!

Pascal_2016
Posts: 87
Joined: Wed Aug 31, 2016 4:48 pm
Been thanked: 4 times
Contact:

Re: Error in the SPI interface

Postby Pascal_2016 » Fri Aug 23, 2019 12:32 pm

Hello

" Are you 100% sure the SPI bus is working and you are addressing right device? "
-> I am sure that the SPI interface doesn't work under flowcode 8, because it works under Arduino-IDE with the same display.

" On FC7 i remeber the ENC ethenet module had habit to stuck the program when trying to initialize the module, when it was not present...
Could this be same thing?
"
-> If this is the problem, the display should also not work under Arduino IDE.

" Have you tested that the display works? "
-> I am sure that the display will work, because with the Arduino IDE the display will work (the structure has not been changed).

User avatar
LeighM
Matrix Staff
Posts: 2009
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 688 times
Contact:

Re: Error in the SPI interface

Postby LeighM » Fri Aug 23, 2019 1:05 pm

Hi,
You have the SPI properties set to CS on port C2, this should be B2
There is a note in the compiler output text about the need to set the SS pin as output or use as the CS pin

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Error in the SPI interface

Postby Lagoda » Fri Aug 23, 2019 1:58 pm

Hi,

The Clk output of the SPI module and the LED are both connected to the B5 port.
Is that what you wanted?

Lagoda

User avatar
LeighM
Matrix Staff
Posts: 2009
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 688 times
Contact:

Re: Error in the SPI interface

Postby LeighM » Fri Aug 23, 2019 2:07 pm

No,
Your properties are set like this ..

spi.jpg
spi.jpg (34.16 KiB) Viewed 826 times

Have you got CS connected on your device?
It would better to use B2 as CS
If not, then you must set B2 as an output (this is the AVR SPI SS pin)

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Error in the SPI interface

Postby Lagoda » Fri Aug 23, 2019 2:45 pm

Hi Leigh,

I'm sorry! :)
I wanted to ask from Pascal_2016 but forgot to type the username in the address bar.

Best Regards,

Lagoda

User avatar
LeighM
Matrix Staff
Posts: 2009
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 480 times
Been thanked: 688 times
Contact:

Re: Error in the SPI interface

Postby LeighM » Fri Aug 23, 2019 3:00 pm

Ah, I see what you mean, sorry, my mistake on that :oops:
You were right to ask :D