Skip to content

IO Mapping

The nXPico exposes a single IO module (ModuleId 1704) under the device node. All channels appear automatically in the I/O mapping view as soon as the device is added to the project — see Getting Started.

Every channel has a DefaultMapping name: IN0, OUT0, AN0… are used directly in ST, without declaring or mapping anything.

ChannelParameter IDTypeGPIODefault mapping
Input 01000BITGP2IN0
Input 11001BITGP3IN1
Input 21002BITGP6IN2
Input 31003BITGP7IN3
Input 41004BITGP20IN4
Input 51005BITGP21IN5
Input 61006BITGP22IN6

Inputs are GPIO reads, sampled once per bus cycle.

ChannelParameter IDTypeGPIODefault mapping
Output 02000BITGP10OUT0
Output 12001BITGP11OUT1
Output 22002BITGP8OUT2
Output 32003BITGP9OUT3
Output 42004BITGP14OUT4
Output 52005BITGP15OUT5

Every digital output can be driven as PWM at runtime. The digital behaviour stays the default: nothing changes until the application asks for it.

ChannelParameter IDTypeDrives
PWM_ENABLE9100WORD (output)bit n = output n in PWM, bit 6 = onboard LED
PWM09000WORD (output)GP10, in place of OUT0
PWM19001WORD (output)GP11, in place of OUT1
PWM29002WORD (output)GP8, in place of OUT2
PWM39003WORD (output)GP9, in place of OUT3
PWM49004WORD (output)GP14, in place of OUT4
PWM59005WORD (output)GP15, in place of OUT5
PWM_LED9006WORD (output)GP25, in place of LED

These are the same six pins, not six extra outputs. PWM<n> and OUT<n> are two views of one physical output, and PWM_ENABLE decides which one commands it.

PWM_ENABLE := 2#0000_0100; (* bit 2 -> OUT2 becomes a PWM output *)
PWM2 := 32768; (* 50% duty *)

Clear the bit and the pin goes back to being a GPIO driven by OUT2.

The value is 0…65535 with no scaling: 0 is always low, 65535 is always high, whatever frequency is set. The carrier is about 2.3 kHz, from a 16-bit wrap on a 150 MHz system clock.

The frequency is a device parameter, not an I/O channel: it is a plant decision — you make it knowing what is wired to the terminal — not a process value that changes every cycle. Set it in the device’s Internal Parameters tab; it is applied when the application starts.

ParameterIDCoversDefault
PWM frequency OUT0/OUT19200GP10, GP112289 Hz
PWM frequency OUT2/OUT39201GP8, GP9 and the LED2289 Hz
PWM frequency OUT4/OUT59202GP14, GP152289 Hz

One parameter per pair, not per output, because wrap and the divider are slice registers and the pins are paired onto slices. A per-output setting would be a promise the hardware cannot keep.

Range 9 Hz…100 kHz. The duty stays 0…65535 whatever the frequency: the runtime rescales it onto the slice’s real step count. What changes is the resolution underneath:

FrequencySteps per periodResolution
50 Hz (servo)6521716 bit
1 kHz5000015.6 bit
2289 Hz (default)6553016 bit
20 kHz (silent motor drive)750012.9 bit
100 kHz150010.6 bit

The default is the frequency that gives full 16-bit resolution. Leave it alone and nothing changes.

The other limit is the frequency, which is the same for both outputs of a pair. Pins are paired onto slices — GP8/GP9, GP10/GP11, GP14/GP15 — and a slice has one wrap and one divider: that is why there is one parameter per pair (9200, 9201, 9202). Independent levels, frequency shared by the pair.

A multimeter in DC volts reads the average, so it reads duty × 3.3 V: about 1.65 V at 50%. On a digital pin an intermediate reading is itself the proof that the output is switching. If the meter has a Hz function, it should read ~2289 Hz.

12-bit ADC, raw value 0…4095 — no scaling is applied by the runtime.

ChannelParameter IDTypeGPIOADCDefault mapping
Analog 03000WORDGP26ADC0AN0
Analog 13001WORDGP27ADC1AN1
Analog 23002WORDGP28ADC2AN2

Input range is 0…3.3 V, so one count is roughly 0.8 mV.

ChannelParameter IDTypeGPIODefault mapping
LED4000BIT (output)GP25LED
ChannelParameter IDTypeAccessDefault mapping
Temperature5000REAL (input)readTEMPERATURE
Vendor393218STRINGread-only'nexo S.r.l.'
Model Name393219STRINGread-only'IO'

TEMPERATURE is the RP2350A’s internal die temperature in °C, computed from ADC4. It measures the chip, not the environment: expect it to read above ambient.

GPIOUsed by
GP0, GP1Boot/diagnostic log (UART0 TX on GP0, 115200 8N1) — stops when your application opens COM2, until the next reboot
GP4, GP5COM3 — free until your application opens the port
GP12, GP13COM2 — free until your application opens the port
GP16, GP17, GP19Free (SPI0)
GP18DE (direction) pin of COM2 — free until your application opens the port

See ST Examples for sample code.