SPI read 216 Bit problem

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

Moderator: Benj

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

SPI read 216 Bit problem

Post by stefan.erni »

Hi Ben

With the SPI GetBytAarray I can very confortable read all the bit's from the ADS1299 from Ti.
But the master OUT give always somthing to the DIN from the ADS1299. Thats a problem for the ADS1299. It changed the config of the ADS1299.
On the diagram is no signal expected.
How can I stop it?

regards

Stefan
read_ads1299.PNG
(22.91 KiB) Downloaded 1116 times

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 read 216 Bit problem

Post by Benj »

Hi Stefan,

An SPI operation is bi-directional in that you always simultaneously read and write data at the same time. Usually only one of these is meaningful hence the read and write operations.

So when you are reading data the SPI will be writing data too, 0x55 I believe.

Do you need an alternative value on the output, I could maybe make the dummy send value editable?

The CAL SPI component gives you access to the read/write function allowing you to read and also specify the outgoing byte value if you want to test this fixes the problem.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: SPI read 216 Bit problem

Post by stefan.erni »

Hi Ben

The Spi I use is a software SPI. If I can try with a dummy 0x00 this would be a great help.
This selection could be a function for FC8 SPI component maybe.


regards

Stefan

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: SPI read 216 Bit problem

Post by stefan.erni »

Hi Ben


I found in the C-Code the part with the Master_Byte_1(0x55)
I also add the cal_spi and can see the Master_Byte.
But how I can change it ?

regards

Stefan

0x55.PNG
(15.85 KiB) Downloaded 1093 times
MasterByte.PNG
(69.28 KiB) Downloaded 1093 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: SPI read 216 Bit problem

Post by stefan.erni »

Hi Ben

I do not know how I can change the byte so that I can do a test.


regards


Stefan

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: SPI read 216 Bit problem

Post by stefan.erni »

Hi Ben

The Ad converter has 6 channel with 24bit. I can setup the AD-converter from initial 500Hz sampling-rate to 2000Hz sampling-rate.
If I read 2 channel (6Byte) every thin looks fine.
But if I read 3 channel (9Byte) the AD converter lose the config from channel 1 !
I tried to change the dummy Byte from the SPI but I cant do it.....
So I add after reading 2 channel a write 3Byte dummy data.
If the dummy was 0x55 the channel 1 goes to "inital" samplyng rate.
But if the dummy was 0x00 every thing is fine.

For me is very importen to change the dummy to 0x00 and on the board I have 3 Spi Bus what make it not easyer...

regards

Stefan



3times_0x55--1.PNG
(1.84 KiB) Downloaded 971 times
3times_0x00-1.PNG
(1.95 KiB) Downloaded 971 times
write_dummy-1.PNG
(13.77 KiB) Downloaded 971 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times

Re: SPI read 216 Bit problem

Post by stefan.erni »

Hi Ben

Ok Now I understand how to use CAL SPI and changed the spi to this...
And it's working fine. All the six channel. Perfect.

Thank you for the help

regards

Stefan

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 read 216 Bit problem

Post by Benj »

Hi Stefan,

Excellent glad it's working well for you now and thanks for letting us know.

Post Reply