This is the C driver code for ADXL382 sensor. The MCU used is raspberry pi pico. Data communication is done via SPI. The python file to read sensor data through serial USB and display data on GUI can be found in this repo https://github.com/dauhoangganh/ADXL382_Pico_Streamlit_Example In the main.c, ADXL382 is set up to operate in High performance mode, 8kHz bandwidth and sampling rate (output data rate) at 16KHz.
GPIO 16 (pin 21) MISO/spi0_rx-> SDO/SDO on adxl382 board
GPIO 17 (pin 22) Chip select -> CSB/!CS on adxl382 board
GPIO 18 (pin 24) SCK/spi0_sclk -> SCL/SCK on adxl382 board
GPIO 19 (pin 25) MOSI/spi0_tx -> SDA/SDI on adxl382 board
3.3v (pin 36) -> VS & VDDIO pin on adxl382 board
GND (pin 38) -> GND on adxl382 board
- Open VScode
- Install raspberry pi pico extension
- Clone this repo to your pc
- In VScode raspberry pico windows, import this github project
- Plug the micro-usb cable to Pico while pressing the BOOTSEL button, this sets the pico in bootsel mode
- Click run button at the bottom right corner of vs code to flash the main.uf2 file to pico
- Unplug and plug the cable to pico again
- Open Tera Term and set up COM port
- See the data printed on teraterm