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
Hi Wang,
Have you checked the attributes setting in the properties of the SPI component of Processor Expert?
Regards,
Karthik
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.
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.
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')