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.
Digital Inputs
Section titled “Digital Inputs”| Channel | Parameter ID | Type | GPIO | Default mapping |
|---|---|---|---|---|
| Input 0 | 1000 | BIT | GP2 | IN0 |
| Input 1 | 1001 | BIT | GP3 | IN1 |
| Input 2 | 1002 | BIT | GP6 | IN2 |
| Input 3 | 1003 | BIT | GP7 | IN3 |
| Input 4 | 1004 | BIT | GP20 | IN4 |
| Input 5 | 1005 | BIT | GP21 | IN5 |
| Input 6 | 1006 | BIT | GP22 | IN6 |
Inputs are GPIO reads, sampled once per bus cycle.
Digital Outputs
Section titled “Digital Outputs”| Channel | Parameter ID | Type | GPIO | Default mapping |
|---|---|---|---|---|
| Output 0 | 2000 | BIT | GP10 | OUT0 |
| Output 1 | 2001 | BIT | GP11 | OUT1 |
| Output 2 | 2002 | BIT | GP8 | OUT2 |
| Output 3 | 2003 | BIT | GP9 | OUT3 |
| Output 4 | 2004 | BIT | GP14 | OUT4 |
| Output 5 | 2005 | BIT | GP15 | OUT5 |
PWM outputs
Section titled “PWM outputs”Every digital output can be driven as PWM at runtime. The digital behaviour stays the default: nothing changes until the application asks for it.
| Channel | Parameter ID | Type | Drives |
|---|---|---|---|
PWM_ENABLE | 9100 | WORD (output) | bit n = output n in PWM, bit 6 = onboard LED |
PWM0 | 9000 | WORD (output) | GP10, in place of OUT0 |
PWM1 | 9001 | WORD (output) | GP11, in place of OUT1 |
PWM2 | 9002 | WORD (output) | GP8, in place of OUT2 |
PWM3 | 9003 | WORD (output) | GP9, in place of OUT3 |
PWM4 | 9004 | WORD (output) | GP14, in place of OUT4 |
PWM5 | 9005 | WORD (output) | GP15, in place of OUT5 |
PWM_LED | 9006 | WORD (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.
Enabling it
Section titled “Enabling 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.
Changing the carrier frequency
Section titled “Changing the carrier frequency”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.
| Parameter | ID | Covers | Default |
|---|---|---|---|
| PWM frequency OUT0/OUT1 | 9200 | GP10, GP11 | 2289 Hz |
| PWM frequency OUT2/OUT3 | 9201 | GP8, GP9 and the LED | 2289 Hz |
| PWM frequency OUT4/OUT5 | 9202 | GP14, GP15 | 2289 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:
| Frequency | Steps per period | Resolution |
|---|---|---|
| 50 Hz (servo) | 65217 | 16 bit |
| 1 kHz | 50000 | 15.6 bit |
| 2289 Hz (default) | 65530 | 16 bit |
| 20 kHz (silent motor drive) | 7500 | 12.9 bit |
| 100 kHz | 1500 | 10.6 bit |
The default is the frequency that gives full 16-bit resolution. Leave it alone and nothing changes.
Two limits worth knowing
Section titled “Two limits worth knowing”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.
Measuring it
Section titled “Measuring it”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.
Analog Inputs
Section titled “Analog Inputs”12-bit ADC, raw value 0…4095 — no scaling is applied by the runtime.
| Channel | Parameter ID | Type | GPIO | ADC | Default mapping |
|---|---|---|---|---|---|
| Analog 0 | 3000 | WORD | GP26 | ADC0 | AN0 |
| Analog 1 | 3001 | WORD | GP27 | ADC1 | AN1 |
| Analog 2 | 3002 | WORD | GP28 | ADC2 | AN2 |
Input range is 0…3.3 V, so one count is roughly 0.8 mV.
Onboard LED
Section titled “Onboard LED”| Channel | Parameter ID | Type | GPIO | Default mapping |
|---|---|---|---|---|
| LED | 4000 | BIT (output) | GP25 | LED |
System
Section titled “System”| Channel | Parameter ID | Type | Access | Default mapping |
|---|---|---|---|---|
| Temperature | 5000 | REAL (input) | read | TEMPERATURE |
| Vendor | 393218 | STRING | read-only | 'nexo S.r.l.' |
| Model Name | 393219 | STRING | read-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.
Pins not used by the I/O map
Section titled “Pins not used by the I/O map”| GPIO | Used by |
|---|---|
| GP0, GP1 | Boot/diagnostic log (UART0 TX on GP0, 115200 8N1) — stops when your application opens COM2, until the next reboot |
| GP4, GP5 | COM3 — free until your application opens the port |
| GP12, GP13 | COM2 — free until your application opens the port |
| GP16, GP17, GP19 | Free (SPI0) |
| GP18 | DE (direction) pin of COM2 — free until your application opens the port |
See ST Examples for sample code.