Spi mode - Processor expert - Kl25

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Spi mode - Processor expert - Kl25

1,392 次查看
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

标签 (2)
4 回复数

830 次查看
dkarthik
Contributor II

Hi Wang,

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

Regards,

Karthik

830 次查看
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 项奖励

830 次查看
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.

830 次查看
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 项奖励