© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
DevHeads IoT Integration ServerDIIS
DevHeads IoT Integration Server•2y ago•
3 replies
Dtynin

Why Is My AVR32UC ADC Returning Zero Despite a Correct Input Signal?

Hey everyone, I'm currently working on reading an analog value using the ADC on my AVR32UC microcontroller, but I'm running into a problem where the ADC consistently returns zero, even though the input signal is correct. I've verified that the ADC driver is enabled in the
prj.conf
prj.conf
file, and also ensured that the ADC channel being used corresponds to the correct pin on the microcontroller.
Here's the code I'm using:
#include <zephyr.h>
#include <device.h>
#include <drivers/adc.h>

#define ADC_CHANNEL 1
#define ADC_DEV "ADC_0"

void main(void) {
    const struct device *adc_dev = device_get_binding(ADC_DEV);
    struct adc_sequence sequence = { .channels = BIT(ADC_CHANNEL) };
    adc_read(adc_dev, &sequence);
}
#include <zephyr.h>
#include <device.h>
#include <drivers/adc.h>

#define ADC_CHANNEL 1
#define ADC_DEV "ADC_0"

void main(void) {
    const struct device *adc_dev = device_get_binding(ADC_DEV);
    struct adc_sequence sequence = { .channels = BIT(ADC_CHANNEL) };
    adc_read(adc_dev, &sequence);
}

The issue I’m facing:
error: Failed to get binding for ADC device
error: Failed to get binding for ADC device

Despite these efforts, the ADC still returns zero consistently. Does anyone have suggestions on what might be causing this, or how I can troubleshoot further?
Solution
@Dtynin It seems like your ADC isn't working because the binding for the ADC device isn't found, and your ADC configuration might be incomplete. Check your device binding and sequence configuration
Jump to solution
DevHeads IoT Integration Server banner
DevHeads IoT Integration ServerJoin
The DevHeads IoT Integration Server accelerates technology engineering by helping pro devs learn, share and collaborate.
2,984Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

What is the purpose of HAL_ADC_PollForConversion in STM32 HAL ADC code?
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🪲-firmware-and-baremetal
2y ago
Why isn't my ADC with DMA setup updating the variable correctly on the STM32F407ZGT6?
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🪲-firmware-and-baremetal
2y ago
Trouble Creating a Thread on AVR32UC with Zephyr – Any Tips?
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🪲-firmware-and-baremetal
2y ago
How to Expand 10-Bit ADC Signal for 16-Bit SPI Communication Between Two Arduino Unos
DevHeads IoT Integration ServerDIISDevHeads IoT Integration Server / 🪲-firmware-and-baremetal
17mo ago