!! SPI-protocol compiling ERROR with FC 6

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

Moderator: Benj

Post Reply
Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

!! SPI-protocol compiling ERROR with FC 6

Post 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
Attachments
FC6_SPI_read_ERROR.jpg
FC6_SPI_read_ERROR.jpg (83.49 KiB) Viewed 6400 times
FC5_SPI_read_OK.jpg
FC5_SPI_read_OK.jpg (87 KiB) Viewed 6400 times

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: !! SPI-protocol compiling ERROR with FC 6

Post by LeighM »

Looks like you might need to check the SPI mode and clock phase, they are different between your V5 and V6 images,

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

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

Post 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

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: !! SPI-protocol compiling ERROR with FC 6

Post by LeighM »

Hi
The SPI component has properties here ...
spi.jpg
spi.jpg (25.35 KiB) Viewed 6381 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.

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

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

Post 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

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: !! SPI-protocol compiling ERROR with FC 6

Post by LeighM »

Have you tried changing the clock phase?

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

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

Post 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

Post Reply