Troubleshooting ADC Configuration for Sensor Data Acquisition on AVR128DA48 with Zephyr OS
hey guys on my Smart Industrial Monitoring System project, I've connected a vibration sensor (MPU6050) and temperature sensor (DS18B20) to the AVR128DA48. I'm using Zephyr OS, and I've configured the ADC for reading the sensor data. Below is the code I'm using to initialize the ADC for reading sensor data:
However, I'm getting
no readings
from the sensors. What could be wrong with my ADC configuration, and how can I ensure correct sensor data acquisition?Solution:Jump to solution
Do you have the correct ADC device name, we make mistakes like this attimes . In the Zephyr OS, the ADC device names may vary depending on the hardware you're using. Instead of "ADC_0", check your board’s device tree for the correct device name. Print out the available devices with:
```
const struct device *adc_dev = device_get_binding(DT_LABEL(DT_NODELABEL(adc0)));
if (!adc_dev) {
printk("Failed to bind to ADC_0 device\n");...
2 Replies
Solution
Do you have the correct ADC device name, we make mistakes like this attimes . In the Zephyr OS, the ADC device names may vary depending on the hardware you're using. Instead of "ADC_0", check your board’s device tree for the correct device name. Print out the available devices with:
Just make sure you reference the correct node label for your device
oh yeah, thanks manh @Marvee Amasi I ensured the ADC device name was correct and I had to adjust the resolution also for it.