I'm working on nFR51822 Soc and I wanna use the accelerometer data . Does any one have an idea how to communicate with nRF51822 accelerometer ?
I'm working on nFR51822 Soc and I wanna use the accelerometer data . Does any one have an idea how to communicate with nRF51822 accelerometer ?
In the schematic it's written LIS3DSh , but i didn't find any useful information about it .
If you google LIS3DSH, the first result points to the datasheet: www.st.com/.../DM00040962.pdf
In chapter 6 in that datasheet the interfaces are described (SPI and I2C).
The nRF51 supports both SPI and I2C. If you download the SDK we have an example on how to use the SPI: developer.nordicsemi.com/.../a00046.html
The SPI driver is documented here: developer.nordicsemi.com/.../a00011.html
And the TWI driver is documented here: developer.nordicsemi.com/.../a00014.html
In the schematic it's written LIS3DSh , but i didn't find any useful information about it .
If you google LIS3DSH, the first result points to the datasheet: www.st.com/.../DM00040962.pdf
In chapter 6 in that datasheet the interfaces are described (SPI and I2C).
The nRF51 supports both SPI and I2C. If you download the SDK we have an example on how to use the SPI: developer.nordicsemi.com/.../a00046.html
The SPI driver is documented here: developer.nordicsemi.com/.../a00011.html
And the TWI driver is documented here: developer.nordicsemi.com/.../a00014.html
I Want to use SPI , does Nordic provide a DRIVER_SPI.h ?
Did you see: link ? Tested, works.
Go download the SDK: developer.nordicsemi.com/.../
Open up the SPI master example. This example includes the spi_master.h and shows how to use it.
thanks a lot =) . If i may i ask again : i saw the spi mater example but still i didn't figue out how can i read the x axis , y axis and z axis data ?
You need to be more specific than that:) What is not working? Are you able to use the SPI master on the nRF51 at all? Are you able to compile and flash the code to the chip? Do you have a logic analyzer so you can see the traffic on the SPI bus? Do you know the principle behind SPI communication? How to read and write to registers? Did you look at the accelerometer datasheet and determine which registers you need to write to in order to initialize the chip (if needed)? Did you find the address of the output registers in the datasheet? Did you try to read out information from these output registers?