SPI on v5.5 ARM

Moderator: Benj

Post Reply
User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

SPI on v5.5 ARM

Post by Mantas »

Hi,

I have found several problems with SPI component. First of all there is some kind of a bug in the receive string macro and it's not working (there are 3 parameters in the functions when calling, but only 2 are available for input). Next, I have looked at the CAL file and there are 4 options to set the clock for SPI, but in FC, there are only 3. Also there is this DAC enable pin in connections dialog menu, but no macros for it to use. Also when I tick in config menu to display simulations in HEX, it still displays in decimals. And all in all, I failed to use SPI successfully in Soft mode and in Hard mode, on A and B ports, on EB185. I have an expensive sensor, so I would really appreciate some kind of fix.

Best regards,
Mantas
Science is my true religion.

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: SPI on v5.5 ARM

Post by Mantas »

I am waiting for my logic analyzer to arrive, so I will be able to tell why SPI is not functioning properly, hopefully at the end of this week.

Regards,
Mantas
Science is my true religion.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: SPI on v5.5 ARM

Post by Benj »

Hi Mantas,

Ok let us know how your getting on with your analyser.

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: SPI on v5.5 ARM

Post by Mantas »

Hi Benj,

So i have debugged my sensor with logic analyzer, and fixed some issues in the setup, i mixed the MISO AND MOSI lines as the naming in the FL was SDO and SDI :) Nevermind, it's now working in SW mode, just found one issue, which actually does not make any errors in communication with sensor, just the logic analyzer software detects an issue, as the wrong initial clock state. I use CPOL=0, and CPHA=0. Here's the screenshot. Maybe it's possible to fix this in the upcoming releases, so that initial clock state would be low from the beginning.

Also I was wondering whether it is possible to increase the clock speed? At the moment I use Fosc/4 in the and the analyzer registers 81.356kHz, where my sensor can go all the way up to 1MHz.

Cheers,
Mantas.
SPI.png
Screenshot
(184.85 KiB) Downloaded 1410 times
Science is my true religion.

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: SPI on v5.5 ARM

Post by Mantas »

Good afternoon,

Some updates: Hardware SPI works perfectly, and clock speed is as it should be, and can go all the way up to >5MHz, when in Fosc/4 mode. and initial state is also correct.

Also could you please make it in v6 possible to disable DAC and NVM pins, because now if I leave them unconnected it chooses default values automatically.

Regards,
Mantas
screenshot.png
scrnsht
(200.2 KiB) Downloaded 1389 times
Science is my true religion.

Post Reply