Task #3555
openTask #3553: ADXL345 testing
Software development and testing
Updated by Thomas Joseph 4 months ago
Developed program for SPI communication
SPI mode 3
Clock/MOSI/CS correct
Tried devide id
MISO always Low
Options
- SPI read other registers
- use I2C
- ADXL335 - anlaog o/p
- TV 2.1 - none of ADC pins terminated, REF
- TV3.0
- E54 - integrated ADC, ref - internal
- E54 with ADS1115
Updated by Gowri G 3 months ago
- Status changed from New to Hold
- % Done changed from 0 to 80
- Estimated time set to 16:00 h
Details of Project:
The project uses SPI communication between the SAM L21 microcontroller and the ADXL345 sensor.
The SPI module is initialized in Master mode.
The ADXL345 sensor works in SPI Mode 3 configuration.
A Chip Select (CS) pin is used to enable and disable sensor communication.
The ADXL345_Write() function writes data into sensor registers.
The ADXL345_Read_DeviceID() function reads the sensor Device ID register.
SPI transfer is performed using transmit and receive buffers.
The received data is printed through UART using printf().
The expected ADXL345 Device ID value is 0xE5.
Successful reading of the Device ID confirms proper SPI communication.
Test Conducted:
Oscillation angle: 30 degree
No of Oscillations: 10
Time taken for 10 oscillations: 1min 52 sec 100 milliseconds
Fan Running Speed: Full Speed
For Oscillation time: approximately 9 Seconds.
Source Code:
https://elpisit.sharepoint.com/:u:/s/EmbeddedFiles/IQCN3A2i8zGnQoPf5z1S9A7PAZ7j-FflDDZ-60VxTPa6MWU?e=mSQIlb