Nano RP2040 using NINA's ADC problem

Hi!

I wanted to test the 12 bit ADC at A6, A7 pins (NINA's module ADC channels). The A4,A5 pins are occupied because I'm using the I2C interface (LCD 16x2). Apparently, the A6, A7 pins are constantly at high state. I didn't know it and I attached the voltage from voltage divider (10K potentiometer - as you can see on the picture). Now I'm constantly getting max readings from ADC (4095). When I measured the voltage on the pin A6 it shows 3.5V. I didn't short circuit anything.Down below I'm attaching my code. Does anyone know how to fix the problem?

Thank you in advice! J.K

#include <Wire.h>
#include "DFRobot_LCD.h"
#include <WiFiNINA.h>

DFRobot_LCD lcd(16,2);  //16 characters and 2 lines of show

//#define potPin A6 // RP2040 Analog Pin ADC0 = A0

int potValue = 0; // value read from the POT
float Volt = 0;

void setup() {

    
    //analogReadResolution(12);
    lcd.init();
    // Print a message to the LCD.
    lcd.setCursor(0, 0);
    lcd.print("ADCval");
    lcd.setCursor(0, 1);
    lcd.print("Voltage:");
    lcd.setCursor(15, 1);
    lcd.print ("V");
}

void loop() {
  // Reading potentiometer value
  
  potValue = analogRead(A7);
  Volt = ((potValue*3.271)/4095); 

  lcd.setCursor(9, 0);
  lcd.print (potValue); // value ADC
 
  lcd.setCursor(9, 1);
  lcd.print (Volt,3);  //value Volts
}

Please update the package for "Arduino MBed OS Nano boards" to 2.2.0. Then A7 will work. The analogue pins A4 ... A7 are connected to the Nina-Chip and they needs some special support.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.