Page 1 of 1

Error in the SPI interface

Posted: Thu Aug 22, 2019 10:39 pm
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

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 8:33 am
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?

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 12:32 pm
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).

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 1:05 pm
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

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 1:58 pm
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

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 2:07 pm
by LeighM
No,
Your properties are set like this ..

spi.jpg
spi.jpg (34.16 KiB) Viewed 833 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)

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 2:45 pm
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

Re: Error in the SPI interface

Posted: Fri Aug 23, 2019 3:00 pm
by LeighM
Ah, I see what you mean, sorry, my mistake on that :oops:
You were right to ask :D