2023-10-16 06:01 AM
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)).
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.
Is there a way to communicate with Motorola NSS mode with (Clock polarity 1 and clock phase 1(2nd edge)) using STM32L4 EVK?
2023-10-17 09:10 AM - edited 2023-10-17 09:11 AM
> 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?