cancel
Showing results for 
Search instead for 
Did you mean: 

Query in changing the clock phase from 0 to 1 on STM32L412 Series EVK in Motorola mode.

Dev_k
Associate II

Hi Experts,
I have used a SM32L412 series EVK (Master) and thought of interfacing it with ICM-42688P sensor
(Slave) using SPI interface.
As per ICM-42688 4 wire SPI timing diagram and spec, we conclude that it will work on Motorola NSS
mode with (Clock polarity 1 and clock phase 1(2 nd edge)).

Dev_k_0-1697461121034.png

And I configured the MCU with the above configuration using STM32CubeIDE and tried to communicate with the slave device. Communication is not happening properly and by probing the CS, CLK, MISO and MOSI lines using oscilloscope, there is no transaction on MISO line. The address sent from master is not properly sampled by slave.

Later, surfing the google regarding this issue, I came across this document “STM32L4 - SPI Serial Peripheral Interface REV 2.0”. In this, it is mentioned that Motorola will support only CPHA =0.

Dev_k_1-1697461158591.png

 

Is there a way to communicate with Motorola NSS mode with (Clock polarity 1 and clock phase 1(2nd edge)) using STM32L4 EVK?

1 REPLY 1

> Communication is not happening properly and by probing the CS, CLK, MISO and MOSI lines using oscilloscope, there is no transaction on MISO line.

If there's appropriate activity on other lines, this means, that the slave device does not respond. Check the connections to the slave.

According to ICM-42688-P datasheet chapter 9.6.SPI INTERFACE: CS goes low (active) at the start of transmission and goes back high (inactive) at the end.  It means, you are not supposed to pulse NSS between bytes, thus you don't need to set STM32's SPI to "NSS Pulse mode" and thus the CPHA restriction does not apply.

At the end of the day, for initial experiments, you can bit-bang the protocol.

JW

 

PS> What is STM32L4 EVK?