Spi mode - Processor expert - Kl25

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Spi mode - Processor expert - Kl25

1,344 Views
wilk
Contributor II

Hello,

How can I configure spi mode 3 in Processor expert for the kl25 please ?

The data changes on the falling edge of the clock and is read/written on the rising edge of the clock.

Thanks !

Best regards

Labels (2)
4 Replies

782 Views
dkarthik
Contributor II

Hi Wang,

Have you checked the attributes setting in the properties of the SPI component of Processor Expert?

Regards,

Karthik

782 Views
wilk
Contributor II

Sure I checked it, there are 3 possibilities :

- rising or falling edge

- falling edge

- rising edge

The point is that I don't understand which one would be appropriate to spi mode 3.

0 Kudos

782 Views
dkarthik
Contributor II

Let us know what is SPI mode 3.

In general, the appropriate settings depend on the devices that are communicating. If your MCU is master and you are communicating with a slave, settings for both the devices should match.

782 Views
BlackNight
NXP Employee
NXP Employee

there are three fundamental settinigs for SPI:

- bit order: MSB or LSB

- clock idle polarity: high or low

- clock shift edge: data is shifted on raising or falling edge

Clock polarity and shift edge (two values) build the four modes. See Serial Peripheral Interface Bus - Wikipedia, the free encyclopedia

I assume that your device is using MSB, so configure this as such.

From your original question, it looks you need to set it to 'shifted at rising edge'.

Clock idle polarity: check your device data sheet.

Have a look at Tutorial: Nordic Semiconductor nRF24L01+ with the Freescale FRDM-K64F Board | MCU on Eclipse (search for 'polarity')

0 Kudos