cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2DH SPI not Working

madhusudank
Associate
Posted on April 02, 2016 at 11:15

I am using LIS2DH spi to communicate with nrf51822. I have set CPOL =1(active Low) and CPHA=1(trailing). I am able to see CS , MOSI and CLOCK properly but MISO pin is always high.Below is my code.

                         nrf_gpio_pin_clear(SPIM0_SS_PIN);

                        NRF_SPI0->TXD = 0x8F;    

                        NRF_SPI0->TXD = 0x00;

                        while(NRF_SPI0->EVENTS_READY == 0){}

                        NRF_SPI0->EVENTS_READY = 0;

                        receive_rx[0] = NRF_SPI0->RXD;

                        receive_rx[1] = NRF_SPI0->RXD;  

                        nrf_gpio_pin_set(SPIM0_SS_PIN);

can someone help me in debugging this.It would be a great help

#lis2dh-spi-configuration
1 REPLY 1
michaelbeaster9
Associate
Posted on May 17, 2016 at 15:48

Hi there. Did you ever get this working? I seem to be in the exact same scenario with a similar ST part. Thanks.