SPI high speed problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
moro_1580446
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi,I am use SPI component on psoc5 series CY8C5888LTI Prototype kit in master mode and SPI mode_1 to communicate with AFE4400(TI company)(AFE4400 spi sclk is 8MHz).I use SPI component with in psoc creator that attach. But the problem is spi data write function in output.when i am select 8Mhz on sclk it is not create true sclk on output in data write but when i select low sclk clock like 250k or 800k or other below 1MHz it is worked well.I need 8Mhz on sclk so I do not know what is mistake exactly?

Why SPI component does not work on 8Mhz sclk?(Cypress datasheet say SPI can work up to 18MHz sclk)

Below is picture out put on oscilloscope.

PLL clock is select on 64Mhz.

I choose Enable high speed on spi component but it not difference on my problem in output.

Is there any body to help me and say me how can I solve it?

Here is the output signal show on oscilloscope that show spi component does not work correctly on 8Mhz sclk.(first is on 250KHz and second picture is on 8MHz)

please regurd me how can solve this problem with spi component?

Thanks for attention...

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I tried it with my CY8CKIT-059.

Yellow the top line is CS

Blue the second line is SCLK

Magenta the third line is MOSI

Green the fourth line is MISO (which is connected to no where...)

(1) 4 bytes transaction seems to be working OK

TEK0000.jpg

(2) The first byte, I can count 8 clocks.

TEK0001.jpg

(3) The second byte, I can count 8 clocks.

TEK0002.jpg

(4) The third byte, I can count 8 clocks.

TEK0003.jpg

(5) The fourth byte, I can count 8 clocks.

TEK0004.jpg

Conclusion, with my setup I can count 4 x 8 = 32 clocks.

So I think that your system may have interrupt or something which interrupts the transaction of the SPI.

moto

P.S. Attached is your project, which I modified the clock tree just like my previous response.

View solution in original post

9 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

In the datasheet of SPI component, it is written

001-SPI_ClockSelection.JPG

But currently, you are  providing 8MHz to the SPI component.

012-sch.JPG

How about changing the frequecny of Clock_1 to 16MHz?

moto

P.S. Schematic was replaced with the one without pointer at the wrong spot.

thanks for answer dear Motoo Tanaka.my problem is not Clock_2,because psoc produce it correctly but on Clock_1 it has warning i change it to 16MHz or upper but it is not solved yet. Another one I change Clock type from new to exsiting mode iwarning removed but not working true.What can i do to solve that becuase AFE4400 work on spi in 8 MHz sclk.

it is very important for me...

thanks for attention...

0 Likes

Is it possible pin configuration is not true and i should to chage that?another question is it depond on psoc5 Xtal?should I change on external?

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

The screen shot was my mistake, my pointer was left there, but I was talking about Clock_1.

Anyway, I played with the DWR > System Clocks

If the GUI is correct, the accuracy of IMO is best when OSC = 3MHz (+/- 1%)

Then I feed it to the PLL and got 64MHz.

But it exceeded the the max frequency of the bus so I divided it by 2 for Master Clock and Bus Clock.

With these I got 16MHz +/-1% for Clock_1 from the PLL_OUT.

I wonder if this is acceptable for your AFE44xx.

In case this accuracy is not sufficient, you may need to consider the external crystal / osc.

010-DWR-Clock.JPG

011-system-clocks.JPG

moto

P.S.

Note: I just found the following AN54439 - PSoC3 and PSoC 5LP External Crystal Oscillators..

https://www.cypress.com/documentation/application-notes/an54439-psoc-3-and-psoc-5lp-external-crystal...

I do that and it help to remove warrning about clock setting but my problem exist already. I should to write 4 byte data in each register so it should do on 32 pulse on sclk,when i select 250Kbps its worked correctly but when i choose upper clock like 1Mbps psoc5 can not creat 32 pulse clock and it creat just 30 pulse on sclk.when i choose 8 Mbps psoc5 do that on 16 clock. I think cypres creator has a problem in high speed in SPI.But I do not know how can solve that?

I try to changed source clock from internal to external with 24.000000MHz crystal but it is not difference and my problem does not solve.

please guide me...

Thanks for attention...

0 Likes

Hi moro_1580446​,

Please share with us the latest psoc creator with the changes you have made.

Please share screen shots of the waveform you are observing at different speeds.

Regards,

Bragadeesh

Regards,
Bragadeesh
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I tried it with my CY8CKIT-059.

Yellow the top line is CS

Blue the second line is SCLK

Magenta the third line is MOSI

Green the fourth line is MISO (which is connected to no where...)

(1) 4 bytes transaction seems to be working OK

TEK0000.jpg

(2) The first byte, I can count 8 clocks.

TEK0001.jpg

(3) The second byte, I can count 8 clocks.

TEK0002.jpg

(4) The third byte, I can count 8 clocks.

TEK0003.jpg

(5) The fourth byte, I can count 8 clocks.

TEK0004.jpg

Conclusion, with my setup I can count 4 x 8 = 32 clocks.

So I think that your system may have interrupt or something which interrupts the transaction of the SPI.

moto

P.S. Attached is your project, which I modified the clock tree just like my previous response.

lock attach
Attachments are accessible only for community members.

It solve. I think oscilloscope probes should be connect near.My mistake is when i want to check SPI signal it is far from pin out of micro controller.so its not work as I want.here is the result of oscilloscope screen shot.

now i do not know why AFE4400 does not answer to my read and write function in SPI.Is there any body to know where is the problem?

here is my schematic and PCB.Please guide me to find problem.

thanks for attention...IMG_20200701_123112.jpg

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

> It solve.

Thank you for the good news!

> Is there any body to know where is the problem?

As this discussion is already marked as "Answered", not many will keep looking into this.

And as the issue of the question is now about the communication between the sensor and psoc.

So I would suggest you create a new question/discussion with a title that reflects the issue.

Probably adding keywords SPI, AFE4400, communication fails or does not get a response from the sensor, or something like that.

moto