SPI Master App: Wrong clock polarity

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.
Markus_S
Level 2
Level 2
First like received 10 sign-ins 5 questions asked
Hi,

I'm using the SPI_Master app in Dave 4.42 with a XMC2Go board.

The App-configuration is seen in the attached picture SPI_Master_App_Setup.PNG.
You see that the SPI-Clock is set to High if active, transmit on rising edge.

Looking at the clock and data output pins signals (see attached word document)
it is clear that the data is taken not at the rising but at the falling edge, opposite to what is expected from
the App configuration.
If the App is configured to data at falling edge the data is in reality sampled at rising edge instead.

So it appears thate the clock edge is set opposite to what I choose in the App setup.

Is this an error in the App or are there any other hidden settings that I'm not aware off?
0 Likes
5 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

You are asking for data shifted out on the rising edge and sampled on the falling edge. This what is visible on your picture, 01010100 or?

Regards,
Jesus
0 Likes
Markus_S
Level 2
Level 2
First like received 10 sign-ins 5 questions asked
Hi Jesus,
we are looking at the transmit data (on MOSI, blue curve) and the clock output (SCLK, yellow curve). There is not slave connectet in this example. I'm yust looking at the SPI Port pins. It looks to me that the data is clearly valid on falling edge, not on rising edge. So
'transmit' is on falling edge, not as it sould be according to the App configuration, where I want 'transmit on rising clock edge'.
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

In my opinion, your picture shows that the data starts at rising edge and slave have a stable data at the falling edge of the same clock cycle.

Regards,
Jesus
0 Likes
Markus_S
Level 2
Level 2
First like received 10 sign-ins 5 questions asked
Hi,

So maybe the clock-setting reads as: Master transmits data at rising edge and slave receives at falling edge. So "transmit" does not mean the stable data but the data transition. This interpretation makes sense.

Thanks.
0 Likes
stisch
Level 1
Level 1
First reply posted Welcome!

hi,

I have the same problem as you.I can't change the problem by using functions of XMC_SPI_CH_DataLatchedInLeadingEdge().Have you solved the problem yet?Can you tell me how to do that?

Regards,
Stitch
 
0 Likes