Skip to content

ADC has range problems in new dev branchs #5559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saeedbala opened this issue Aug 18, 2021 · 4 comments
Closed

ADC has range problems in new dev branchs #5559

saeedbala opened this issue Aug 18, 2021 · 4 comments
Labels
Area: Peripherals API Relates to peripheral's APIs. Resolution: Expired More info wasn't provided

Comments

@saeedbala
Copy link

saeedbala commented Aug 18, 2021

Hi! I just discovered in the new versions, the ADC ref/attenuation is messed up.
Connecting a 1.65 volt to ADC saturates the values to 4095.
If I decrease the voltage to below 1 Volt, it shows the values that if the reference was connected to a 1 Volt source. So for example a 0.5 Volt voltage has a reading of 2000/4095.
I tried to set the attenuation manually too but still doesn't work. Actually analogSetAttenuation() has no effect at all, even setting it to 0db doesn't make any difference in readings.
This code works perfectly on the stable libraries while it shows saturated values on Dev ones (2..0.0RC):

Hardware:

Board: node32
Core Installation version: 2.0.0RC
IDE name: Arduino IDE
Flash Frequency: 40Mhz
PSRAM enabled: ?no? ?yes?
Upload Speed: 115200
Computer OS: Windows 10

Description:

Describe your problem here
the ADC ref/attenuation is messed up.

Sketch:

//Change the code below by your sketch
void setup() 
{
 
  Serial.begin(115200);
  
  Serial.println("HELLO!");
  analogReadResolution(12);
  analogSetAttenuation(ADC_11db);
 
}
 
void loop() 
{
  Serial.println(analogRead(36));
  delay(500);
}

Debug Messages:

HELLO
4095
4095
4095
@felmue
Copy link

felmue commented Aug 18, 2021

Hello @saeedbala

have a look here.

Thanks
Felix

@marcboon
Copy link

For the moment use: analogSetPinAttenuation(pin, ADC_11db) for each pin you intend to use with ADC, if you need the maximum input voltage range (about 2.55V).

@VojtechBartoska
Copy link
Contributor

Hello @saeedbala, sorry for late reply. Are you able to test your issue on development version 2.0.3-RC1 to check if this is still valid? You can take a look on Docs where is explained how to choose development release version in Arduino IDE.

@VojtechBartoska VojtechBartoska added Resolution: Awaiting response Waiting for response of author Area: Peripherals API Relates to peripheral's APIs. labels Mar 30, 2022
@VojtechBartoska
Copy link
Contributor

Hello,

as there was no answer in last 14 days, I'm closing the issue as expired to keep our backlog manageable. If it's still needed, please reopen the issue.

Thanks for understanding.

@VojtechBartoska VojtechBartoska added Resolution: Expired More info wasn't provided and removed Resolution: Awaiting response Waiting for response of author labels Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs. Resolution: Expired More info wasn't provided
Projects
None yet
Development

No branches or pull requests

4 participants