I'm new to Silicon Labs and SPI communications, and I am wondering how I can read the chip ID of an ADXL362 accelerometer using an EFR32BG, and the 20 pin expansion header, using SPI. What kind of things do I need to do in order to set up the SPI Communication and successfully exchange messages between the board and the sensor?
Thanks!
SiM3L1xx
SiM3U1xx
Discussion Forums
Interface
32-bit MCUs
8-bit MCUs
SiM3C1xx
Unanswered
I know that in the ADXL362, the device ID of the chip is stored in a register with address 0x00. Which function can i use from the spidrv.h library to read in the the register at that address?
Also, is it correct to initialise the SPI data like this?
Ok now I also know that i want to do the following things in the program
1. Set CS to 0 in order to read things.
2. Send 8 bits (0x0B) to the ADXL362, which will tell it that I want to read from the registers (MOSI).
3. Send an additional 8 bits (0x00) that specify that the address I want to read is the one that contains the device ID. (MOSI).
4. Read 8 bits from MISO pin, which should contain the device ID.
What functions will allow me to do the above? I have been looking at the documentation but it is not very clear. Thanks for whatever help you can give.
0
I suggest you read the source code of the driver. unfortunately I did not found an example code that use the spidrv driver. Not sure below link helps or not.
I saw the ADXL362 has some mode that need to configure, I don't know if you configure the ADXL362 correctly or not. You could try probe the SPI signals with an osciloscope to see if the signal was not as expected.
My views are my own and do not necessarily represent the views of Silicon Labs
0
And final update. I now have the 0x0B and 0x00 sending to the ADXL362. For some reason however, I am getting nothing but noise on the MISO channel. You can see this in the picture attached.
First waveform is CLK, second is CS, third is MOSI, and fourth is MISO. Just like on the ADXL362 datasheet, page 20, the MOSI channel is sending what it should. What could be a reason for the MISO being unresponsive?
0
Is your GND connection between the two OK? It is odd that MISO is 'around' instead of above GND.
Read ADXL362 chip ID over SPI using EFR32BG
Hi,
I'm new to Silicon Labs and SPI communications, and I am wondering how I can read the chip ID of an ADXL362 accelerometer using an EFR32BG, and the 20 pin expansion header, using SPI. What kind of things do I need to do in order to set up the SPI Communication and successfully exchange messages between the board and the sensor?
Thanks!
I know that in the ADXL362, the device ID of the chip is stored in a register with address 0x00. Which function can i use from the spidrv.h library to read in the the register at that address?
Also, is it correct to initialise the SPI data like this?
Ok now I also know that i want to do the following things in the program
1. Set CS to 0 in order to read things.
2. Send 8 bits (0x0B) to the ADXL362, which will tell it that I want to read from the registers (MOSI).
3. Send an additional 8 bits (0x00) that specify that the address I want to read is the one that contains the device ID. (MOSI).
4. Read 8 bits from MISO pin, which should contain the device ID.
What functions will allow me to do the above? I have been looking at the documentation but it is not very clear. Thanks for whatever help you can give.
I suggest you read the source code of the driver. unfortunately I did not found an example code that use the spidrv driver. Not sure below link helps or not.
http://devtools.silabs.com/dl/documentation/doxygen/4.2.1/efm32pg1/html/group__SPIDRV.html
I saw the ADXL362 has some mode that need to configure, I don't know if you configure the ADXL362 correctly or not. You could try probe the SPI signals with an osciloscope to see if the signal was not as expected.
My views are my own and do not necessarily represent the views of Silicon Labs
And final update. I now have the 0x0B and 0x00 sending to the ADXL362. For some reason however, I am getting nothing but noise on the MISO channel. You can see this in the picture attached.
First waveform is CLK, second is CS, third is MOSI, and fourth is MISO. Just like on the ADXL362 datasheet, page 20, the MOSI channel is sending what it should. What could be a reason for the MISO being unresponsive?
Is your GND connection between the two OK? It is odd that MISO is 'around' instead of above GND.