The microcontroller on the Nano RP2040 Connect has four analog pins, connected to A0–A3 on the board. The NINA-W10 multiradio module is used to enable analog inputs for the remaining A4-A7 pins on the standard Nano form factor.
Input and output capabilities
Pins A0–A3 are connected to the board’s microcontroller (Raspberry Pi RP2040). These pins can be used like analog pins on most other Arduino boards:
- Write to a pin with analogWrite()
- Read from a pin with analogRead()
If possible, try to use these pins for your project.
Pins A4–A7 are connected to the NINA-W10 multiradio module. These pins have the following limitations:
- They are read-only. You cannot write to these pins.
- Pins A4 and A5 are used by the microcontroller to communicate with some onboard peripherals (I2C), such as the crypto chip (required for Cloud connectivity). Avoid reading from these pins if your project relies on I2C communication.
- The input voltage range is lower than the board’s 3.3 V operating voltage.
The input/output support for the analog pins is summarized in this table:
Pins | In | Out |
---|---|---|
A0–A3 | Yes | Yes |
A5–A6 | Yes* | No |
A6–A7 | Yes | No |
*Pins A4 a A5 are used by the I2C communications bus. Reading from these pins is possible but doing so can interfere with onboard peripherals.
Input voltage range
The range of analog input values that can be read is different for the two sets of pins:
Pins | Voltage range |
---|---|
A0-A3 | 0.0–3.3 V |
A4-A7 | 0.0–2.7 V* |
*With WIFINina firmware 1.4.8 or earlier, the range for these pins are 0.0–1.2 V. Update the firmware to get the full 0.0–2.7 V range.
Increase the analogRead resolution
The analogRead()
function returns 10-bit values (0–1023) by default. You can increase the resolution to 12-bit (0–4095) with the analogReadResolution() function. Just add this code to your setup()
function:
analogReadResolution(12);
Differential nonlinearity spikes on pins A0-A3
The analog-to-digital converter on the RP2040 microcontroller have spikes in DNL (Differential nonlinearity) errors at four values — 512, 1,536, 2,560, and 3,584, limiting performance in some cases.[1]
Further reading
See errata RP2040-E11 (p. 629) in the RP2040 Datasheet. ↩︎