2025-09-18 12:18 AM - edited 2025-09-18 12:18 AM
Hello friends,
I need to connect thirdparty accelerometer SENSOR to STM32F4 series MCU via SPI.
The Sensor Data sheet says:
1) Designed to support any MCU that used software implemented SPI. It is not designed to support any particular hardware implemented SPI.
2) MISO: data bits are shifted out on falling edge of SCK
3) MOSI: each bit is sampled on the rising edge of SCK.
4) Sensor supports full duplex communication
___________________________________________________________________
Please suggest how to implement. Can I use SPI peripheral of MCU? If yes, I am not sure about what should be CPHA for CPOL = 0.
I need full duplex communication.
Solved! Go to Solution.
2025-09-18 5:02 AM
CPOL = 0 and CPHA = 0 clearly from the SPI diagram.
The chip doesn't know if you're using software or hardware SPI. It'll work fine with hardware SPI.
2025-09-18 1:15 AM - edited 2025-09-18 1:19 AM
Hello,
What is the part number / datasheet link for the sensor?
Thanks
2025-09-18 1:27 AM
@Nico3 wrote:thirdparty accelerometer
Why so secretive? Tell us the manufacturer and part number!
How to write your question to maximize your chances to find a solution
@Nico3 wrote:The Sensor Data sheet says:
1) Designed to support any MCU that used software implemented SPI..
That's an odd thing to say!
Please post a link to the datasheet - so that we can see exactly what they said, in context.
Have you tried an internet search for "STM32 + <sensor part number>" ?
2025-09-18 1:54 AM
2025-09-18 1:57 AM - edited 2025-09-18 1:58 AM
STM32+ SCA3100-D04 internet search already tried. Couldn't find anything. All information about sensor posted in below post.
thanks
2025-09-18 2:25 AM - edited 2025-09-18 3:18 AM
Thanks.
Indeed, there it is:
You'll have to contact Murata to ask them what they actually mean by that.
But the Murata SPI frame is shown here:
And the STM32's is here:
via: https://www.st.com/en/microcontrollers-microprocessors/stm32f401rd.html#documentation
So see which one matches.
There's only 4 modes to choose from ...
https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Mode_numbers
2025-09-18 3:21 AM
Note that the "automatic" NSS operation in the STM32F4 is probably not what you expect - or want:
So you'll probably want to do it "manually" in your software.
2025-09-18 3:53 AM - edited 2025-09-18 3:55 AM
I think this is what they meant when they are saying Hardware and software. i have to use CS pin manually. Other than this, I am yet to find out CHPA polarity.
I think the lanugage written in manual is confusing ..looks like auto converted from Chinese/Japanese to English...
2025-09-18 4:00 AM
@Nico3 wrote:I think this is what they meant when they are saying Hardware and software. i have to use CS pin manually
I very much doubt it - that's a specific STM32 gotcha!
Yes, it does look like something got lost in translation.
Please feed back to Murata!
2025-09-18 5:02 AM
CPOL = 0 and CPHA = 0 clearly from the SPI diagram.
The chip doesn't know if you're using software or hardware SPI. It'll work fine with hardware SPI.