Table of Contents
SIOpico
- WIO Overview | WIO Setup | WIO Control | User Bitmaps | WIO Firmware | WIO Mobile | Cable | LEDScript | WIOpi
Slave I/O |
Introduction
The Raspberry Pi Pico can be used as WIOpi I2C slave for common tasks:
- 4 Servos or 32 NeoPixel
- 16 I/O (100ms scan)
- 2 four wire stepper on bank1 (ULN2003)
- up to 2 Charlieplexing signals on bank1
The NeoPixel protocol engine needs all interrupts on the Pico. This is the reason that it is not possible to combine servos and neopixel simultaneous on the same Pico.
SIOpico Firmware
The binary firmware can be downloaded here:
https://wiki.rocrail.net/rocrail-snapshot/SIOpico.ino.rpipico.uf2
Install
- Keep the Pico button pressed at connecting to USB. (Important: The USB cable has to be a data cable, a charging-only cable doesn't work)
- The Pico will behave like a removable drive.
- Copy the SIOpico.ino.rpipico.uf2 file on this drive.
- Ready.
Pins
Configuration | |
---|---|
Servo | GP0 (pin 1) connected to GND |
NeoPixel | GP0 (pin 1) open and connected to LED strip: Needs a 10k pullup. |
I2C Slave address | GP1 and GP2 |
I2C Slave Address | ||
---|---|---|
GP1 (SW1-1) | GP2 (SW1-2) | Address |
off | off | 124 0x7C |
on | off | 125 0x7D |
off | on | 126 0x7E |
on | on | 127 0x7F |
I/O Banks | ||||
---|---|---|---|---|
GP28 Value | Config | Bank 1 | Bank 2 | SW1 |
< 200 | 0 | Input | Output | 1=0 2=0 3=0 4=0 |
> 4000 | 1 | Input | Input | 1=1 2=0 3=0 4=0 |
< 3000 | 2 | Output | Output | 1=0 2=1 3=0 4=0 |
< 2000 | 3 | Output | Input | 1=0 2=0 3=1 4=0 |
< 1500 | 5 | Multiplexing | Input | 1=0 2=0 3=1 4=1 |
< 1000 | 4 | Stepper | Input | 1=0 2=0 3=0 4=1 |
3V3 *------*--[10k]--*--[10k]--*--[10k]--*--[10k]---* GND | | | | SW1 / / / / 1 2 3 4 GP28 *------*---------*---------*---------*--[100k]--* GND
The GP28 value can be checked in the Monitor.
I2C | |
---|---|
SDA | GP4 (pin 6) |
SCL | GP5 (pin 7) |
Max. I2C speed: 100kHz → Default.
NeoPixel | |
---|---|
Data | GP0 (pin 1) |
Servo | |
---|---|
PWM | GP6 (pin 9) |
PWM | GP7 (pin 10) |
PWM | GP8 (pin 11) |
PWM | GP9 (pin 12) |
Via parameters in the signal and value in the object switches can be the jumping back of barriers and shape signals simulated.
The setting is made using hex values. The entry is made as a decimal number.
Example:
Number = 4
Step = 1
Hex 0x14 = Dezimal 20
Stepper | ||
---|---|---|
IN1 | GP10 | GP14 |
IN2 | GP11 | GP15 |
IN3 | GP12 | GP16 |
IN4 | GP13 | GP17 |
I/O | |
---|---|
Bank 1 | GP10…GP17: needs 10k pullup. (8 I/Os because 23/24/25 n.a.) - Adress: 1-8 |
Bank 2 | GP18…GP27 and GP3: needs 10k pullup. (8 I/Os) - Adress:9-16 |
NeoPixel Addressing
Charlieplexing Signal Support
A Rocrail signal with control aspects and port type multiplex, uses 4 pins starting with the port offset.
The refresh rate is about 250µs.
Aspect values are used from the details tab. 24bits are used, the upper 12bits are for blinking.
Example: LED 1 and 2 on and LED 2 blinking: 0x002003 → Aspect value = 8195
A second signal can be defined in Rocrail with address + 100 to combine it with the main signal.
Test Signal
PINOUT
Arduino IDE Monitor
Type ?<enter> in the monitor to check the configuration of the Pico:
SIOpico (c)Rocrail Oct 20 2021 10:47:03 I2C:126 (pixel=0 servo=20003F70 IO=FF 00 servo=00 GP28=4083 CNF=0 IO1=input IO2=output)
Links
SIOpico-01 PCB
Patch
The ADC GP28 needs a 100k pull down resistor which is not on the PCB.
The easiest way is to mount the resistor directly on the Pico board on pin 34 and 38:
In this way the ADC is also stable if the Pico is not mounted on the PCB; The configuration remains 0 as default.