2020-07-24 01:55 AM
I am exploring iis3dwb sensor with stm32f401 nucleo board.i go through the data sheet but not find any information which mode this sensor supported?
so i tried with these 2 setting ,
hspi3.Init.CLKPolarity = SPI_POLARITY_LOW;
hspi3.Init.CLKPhase = SPI_PHASE_1EDGE;
hspi3.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
in both it fail to read who am i register at first attempt after reset and after that value is read correctly.why this is happen and which mode i should i use?
here i attach files i am using as whole project is of 35mb.
I found this driver file for this sensor on git hub is it ok to use this driver? as i not able to find other example code or driver for this sensor
Solved! Go to Solution.
2020-07-30 09:24 AM
Hi @karan , as you can see from datasheet p.9, the supported is SPI mode 3 (please don't confuse it with 3-wires SPI):
This means CPOL 1 and CPHA 1. You can also refer for example to the ST-WINKT1 firmware FP examples in STSW-STWINKT01_V1.3.1\Drivers\BSP\Components\iis3dwb
Please also check this other post if it can be of any help for you.
Regards
2020-07-30 09:24 AM
Hi @karan , as you can see from datasheet p.9, the supported is SPI mode 3 (please don't confuse it with 3-wires SPI):
This means CPOL 1 and CPHA 1. You can also refer for example to the ST-WINKT1 firmware FP examples in STSW-STWINKT01_V1.3.1\Drivers\BSP\Components\iis3dwb
Please also check this other post if it can be of any help for you.
Regards