Page 1 of 1

!! SPI-protocol compiling ERROR with FC 6

Posted: Sat Jan 28, 2017 10:01 pm
by Niro
Hi Guys,

I really had some hard days trying to figure out, why this damn external SPI-Flash didn't answer, although I had no problems with it in former times.
It's hard to belive, but there were quite different SPI signals on my logic analyzer compiling the same SPI 'read' procedure with FC5 and with FC6 on the ATMega 328 !!
The SIN (MOSI on the ATMega) produces with FC6 a quite strange signal, especially on the 'read' command.
With FC5 everything is fine.
Please have a look on the attached pictures and please provide a quick fix or help me to find a workaround, because I need to finish my project urgently.

Btw, this symptoms occur on many SPI devices (I tried different EE /Flash -chips), but strangely enough there are also devices like RTC-chips that have no problems with the incorrect signals on FC6 and give the right answer....

Hope you could help!
Many thanks!!

Niro

Re: !! SPI-protocol compiling ERROR with FC 6

Posted: Sun Jan 29, 2017 11:00 am
by LeighM
Looks like you might need to check the SPI mode and clock phase, they are different between your V5 and V6 images,

Re: !! SPI-protocol compiling ERROR with FC 6

Posted: Mon Jan 30, 2017 2:49 pm
by Niro
Yes, that is right, but I found no option to change this in FC.
But what is more, what the SIN (MOSI) signal produces on the 'read' command seems to be wrong anyway, no matter which mode or the phase you choose.

If I'm wrong, please correct me.

Best regards,
Niro

Re: !! SPI-protocol compiling ERROR with FC 6

Posted: Mon Jan 30, 2017 3:35 pm
by LeighM
Hi
The SPI component has properties here ...
spi.jpg
spi.jpg (25.35 KiB) Viewed 7123 times
When the component does a read it sends a dummy 0x55 on MOSI, it would be unusual for this to cause a problem.
Please try a change of the clock phase property and see if you then get a read.

Re: !! SPI-protocol compiling ERROR with FC 6

Posted: Mon Jan 30, 2017 7:29 pm
by Niro
Hi,

this properties window of the SPI component I already know and I have exactly the same configuration here.
And it is also the same configuration as in FC5, which works quite nice.
Any ideas?

Many thanks
Niro

Re: !! SPI-protocol compiling ERROR with FC 6

Posted: Mon Jan 30, 2017 8:07 pm
by LeighM
Have you tried changing the clock phase?

Re: !! SPI-protocol compiling ERROR with FC 6

Posted: Mon Feb 06, 2017 9:13 pm
by Niro
Hi,

yes, I tried, but it didn't work...
I then wrote the SPI initialization with standard c-code, as advised in the datasheet and did not use SPI macro from flowcode.
Now it works all fine.

Niro