Error in the SPI interface

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

Moderator: Benj

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

Error in the SPI interface

Post by Pascal_2016 »

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 187 times

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: Error in the SPI interface

Post by EtsDriver »

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: 89
Joined: Wed Aug 31, 2016 4:48 pm
Been thanked: 4 times
Contact:

Re: Error in the SPI interface

Post by Pascal_2016 »

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: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Error in the SPI interface

Post by LeighM »

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: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Error in the SPI interface

Post by Lagoda »

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: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Error in the SPI interface

Post by LeighM »

No,
Your properties are set like this ..
spi.jpg
spi.jpg (34.16 KiB) Viewed 5207 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: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Error in the SPI interface

Post by Lagoda »

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: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Error in the SPI interface

Post by LeighM »

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

Post Reply