PiPicoMite02
Contents
- 1 Features
- 2 Pinout
- 3 Pin Marking on Rear
- 4 Schematic
- 5 Connectors
- 6 PicoMite Software
- 7 CircuitPython on PiPicoMite0x Cards
- 8 Factory Test
- 9 Mechanicals
- 10 Issues
- 11 Assembly Sheet
Features
- Raspberry Pi Pico
- All Pico pins brought to headers
- Pico pin marking on rear
- VGA
- 640x480 monochrome resolution
- 320x240 colour resolution
- 1:2:1 - R:G:B - 16 colours
- PS/2 Keyboard
- 5V to keyboard with voltage translator
- Does not require a keyboard that runs at 3.3V
- SD Card
- Full size card
- Up to 32GB
- FAT32 format
- Stereo audio
- PWM with filter
- 3.5mm jack
- 32-bit GPIO
- 2xMCP23017 port expanders
- I2C1 (I2C2 from MMBASIC)
- DB-37 Female connector
- Jumper selectable terminators
- I2C0 connector
- With Interrupt line
- Power options
- 5V power input
- USB Micro on Pico card
- USB B
- 0.1" pitch header
- 3.3V output header
- 5V power input
- 95mmx95mm outline ODAS standard
- (4) 6-32 Mounting holes
BASIC Interpreter
The PicoMiteVGA boots straight into the MMBasic prompt. At which point you can enter, edit and save the program, test BASIC commands and run the program.
MMBasic is a Microsoft BASIC compatible implementation of the BASIC language. It is full featured with floating point, 64-bit integers and string variables, long variable names, arrays of floats, integers or strings with multiple dimensions, extensive string handling and user defined subroutines and functions. Typically it will execute a program up to 100,000 lines per second. Embedded compiled C programs can be used for even higher performance.
Using MMBasic you can use communications protocols such as I2C or SPI to get data from a variety of sensors. You can save data to an SD card, measure voltages, detect digital inputs and drive output pins to turn on lights, relays, etc.
The emphasis with MMBasic is on ease of use and development. The development cycle is very fast with the ability to instantly switch from edit to run. Errors are listed in plain English and when an error does occur a single keystroke will invoke the built in editor with the cursor positioned on the line that caused the error.
Pinout
Pin Marking on Rear
Schematic
Connectors
J1 - I2C (RTC, etc.)
- INT (GP3)
- SCL (GP1)
- SDA (GP0)
- VCC
- GND
Can use Real Time Clocks using the PCF8563, DS1307, DS3231 or DS3232 chips means that the time is always accurately known.
J2, J3 Pico Connectors
Pico Function Mapping
GP | FUNCTION | PICO PIN | GP | FUNCTION | PICO PIN | |
---|---|---|---|---|---|---|
GP0 | I2C0_SDA (J1-I2C) | 1 | GP16 | VGA_HSYNC | 21 | |
GP1 | I2C0_SCL (J1-I2C) | 2 | GP17 | VGA_VSYNC | 22 | |
GP2 | I2C1_INT (MCP23017 if J4 in) | 4 | GP18 | VGA_BLU | 24 | |
GP3 | I2C0_INT (J1-I2C) | 5 | GP19 | VGA_GRN_LO | 25 | |
GP4 | SPARE | 6 | GP20 | VGA_GRN_HI | 26 | |
GP5 | SPARE | 7 | GP21 | VGA_RED | 27 | |
GP6 | AUDIO-L | 9 | GP22 | SPARE | 29 | |
GP7 | AUDIO-R | 10 | RUN | RUN/RESET* | 30 | |
GP8 | PS2_CLK | 11 | GP26 | SPARE | 31 | |
GP9 | PS2_DATA | 12 | GP27 | SPARE | 32 | |
GP10 | SD_SCK | 14 | GP28 | SPARE | 34 | |
GP11 | SD_MOSI | 15 | ADC | ADCREF | 35 | |
GP12 | SD_MISO | 16 | VEN3 | 3.3V ENABLE | 37 | |
GP13 | SD_SLVSEL | 17 | 3.3V | POWER_3.3V | 36 | |
GP14 | I2C1_SDA (2xMCP23017) | 19 | VSYS | PS2_5V | 39 | |
GP15 | I2C1_SCL (2xMCP23017) | 20 |
J4- MCP23017s - I2C Interrupt 2
- Install jumper to connect INTA interrupts from MCP23017s to GP2 on Pico
- No Pull-up
J5 - I2C2 Terminators
- Install shunts to terminate SDA, SCL signals
- Commands
SETPIN GP14, GP15, I2C2 I2C2 OPEN 400, 100 I2C2 WRITE &H20, OC, LEN, B0[, B1...] I2C2 READ &H20, OX, LEN, BUFF()
- &H20 - I2C Address 0x20
- OC: 0=terminate after, 1=chain next
- len - Length of buffer (normally 1 for receive)
- B0,B1... Bytes to send
- BUFF() - receive buffer
J6 - 3.3V Power Out
J7 - 5V Input
- Useful for external 5V
J8 - Audio
- Two Tone Test
- Play a WAV file
OPTION AUDIO GP6, GP7 PLAY WAV "file.wav"
J9 - VGA
The VGA output is 640 x 480 pixels in monochrome mode or 320 x 240 pixels in colour mode with 16 colours (1 bit for red, 2 bits for green and 1 bit for blue). The VGA output is generated using the second CPU on the RP2040 processor plus one PIO channel so it does not affect the BASIC interpreter which runs at full speed on the first CPU. A handfull of components (resistors and a couple of diodes) is all that is required to connect the VGA monitor.
From within your BASIC program you can turn pixels on/off and draw lines, boxes and circles in any colour. Text can be positioned anywhere on the screen and displayed in any colour in a variety of fonts.
The built-in editor within MMBasic works perfectly with the VGA monitor and PS2 keyboard to allow programs to be edited (with colour coded text) and saved to an SD card.
J10 - USB B Power Connectors
- Full size USB B connector
- No USB signal connections, just used for power
J11 - PS/2 Keyboard
The PS2 keyboard connects to the Raspberry Pi Pico via a level shifter and works as a normal keyboard with the function keys and arrow keys fully operational. It can be configured for the standard US layout used in the USA, Australia and New Zealand or specialised layouts used in the United Kingdom, Germany, France and Spain.
P1 - 32-bit GPIO
SetPin GP14, GP15, I2C2 I2C2 OPEN 400, 100 I2C2 WRITE &H20, 0, 2, &H00, &H00 I2C2 WRITE &H20, 0, 2, &H01, &H00 I2C2 WRITE &H21, 0, 2, &H00, &H00 I2C2 WRITE &H21, 0, 2, &H01, &H00
PiPicoMite02 DB37 to DB37RIBBON Pins
P1 | Chip | Port | Bit | DB37RIBBON | P1 | Chip | Port | Bit | DB37RIBBON | |
---|---|---|---|---|---|---|---|---|---|---|
1 | GND | 37 | 20 | GND | 36 | |||||
2 | 0 | B | 7 | 35 | 21 | 0 | A | 0 | 34 | |
3 | 0 | B | 6 | 33 | 22 | 0 | A | 1 | 32 | |
4 | 0 | B | 5 | 31 | 23 | 0 | A | 2 | 30 | |
5 | 0 | B | 4 | 29 | 24 | 0 | A | 3 | 28 | |
6 | 0 | B | 3 | 27 | 25 | 0 | A | 4 | 26 | |
7 | 0 | B | 2 | 25 | 26 | 0 | A | 5 | 24 | |
8 | 0 | B | 1 | 23 | 27 | 0 | A | 6 | 22 | |
9 | 0 | B | 0 | 21 | 28 | 0 | A | 7 | 20 | |
10 | N/C | 19 | 29 | 1 | B | 7 | 18 | |||
11 | 1 | A | 0 | 17 | 30 | 1 | B | 6 | 16 | |
12 | 1 | A | 1 | 15 | 31 | 1 | B | 5 | 14 | |
13 | 1 | A | 2 | 13 | 32 | 1 | B | 4 | 12 | |
14 | 1 | A | 3 | 11 | 33 | 1 | B | 3 | 10 | |
15 | 1 | A | 4 | 9 | 34 | 1 | B | 2 | 8 | |
16 | 1 | A | 5 | 7 | 35 | 1 | B | 1 | 6 | |
17 | 1 | A | 6 | 5 | 36 | 1 | B | 0 | 4 | |
18 | 1 | A | 7 | 3 | 37 | +3.3V | 2 | |||
19 | +3.3V | 1 |
SD1 - SD Card
The PicoMiteVGA firmware reserves eight program storage "slots" in the Raspberry Pi Pico flash memory. Programs can be saved and retreived from these without the need for any additional storage.
For more storage SD cards can be connected with full support for these built into MMBasic including the ability to open files for reading, writing or random access and loading and saving programs. SD cards connect directly to the Raspberry Pi Pico and the firmware will work with cards up to 32GB formatted in FAT16 or FAT32. The files created can be read and written on personal computers running Windows, Linux or the Mac operating system.
OPTION SDCARD GP13, GP10, GP11, GP12
PicoMite Software
PicoMite Source code
Internal MCP23017 Example Code
- Use the MCP23017 Port Expander on the xcard
(External) MCP23017 I2C Demo Code
- External PROTO16-I2C card
- External PIO16-01.BAS - GitHub repo
- MCP23017 Datasheet
- Set all 16 GPIO pins as outputs
- Write alternate patterns, bounce a 1 across the outputs
SetPin GP14, GP15, I2C2 I2C2 OPEN 400, 100 I2C2 WRITE &H20, 0, 2, &H00, &H00 I2C2 WRITE &H20, 0, 2, &H01, &H00 I2C2 WRITE &H20, 0, 2, &H14, &H55 I2C2 WRITE &H20, 0, 2, &H15, &HAA Pause 1000 I2C2 WRITE &H20, 0, 2, &H14, &HAA I2C2 WRITE &H20, 0, 2, &H15, &H55 I2C2 CLOSE
MCP23008 Demo Code
- I2CIO-8 card
- MCP23008 Datasheet
- I2CIO8-Bounce.bas - GitHub repo
- Bounce a bit across the 4 LEDs
- I2CIO8-ReadWrite.bas - GitHub repo
- Read 4 jumpers and write out LEDs
Download MMBASIC
- If the Pico does not already have MMBASIC installed
- Hold button in Pico
- Plug in USB Micro to PC
- Drive will open
- Drop VGA uf2 onto Drive
- System will reboot
- Run TeraTerm
- Serial
Configure MMBASIC
- Setups
- Can copy-paste a line at a time into TeraTerm
- First two will reboot card
OPTION SDCARD GP13, GP10, GP11, GP12 OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3 OPTION COLOURCODE ON
- Remove USB power
- Install SD card
- Apply USB power
CircuitPython on PiPicoMite0x Cards
- The PiPicoMite0x cards can run CircuitPython with some limitations
- Card features for CircuitPython application
- SD support
- 2x MCP23017, 16-bit port expanders
- DB-37
- 5V input
- External I2C
- Card does not have support for
- VGA
- PS/2
- Audio
CircuitPython Digital I/O
- PiPicoMite02_Digio32.py - Library
- Control the (2) MCP23017 parts on the PiPicoMite02
- Provides Arduino-like functions
# digitalWrite(bit,value) # bit = 0-31 # value = 0, 1 # digitalRead(bit) # bit = 0-31 # returns 0, 1 # pinMode(bit,value) # bit = 0-31 # value = INPUT, OUTPUT, INPUT_PULLUP # pinMode(bit,value)
- Digio32Test.py - Example code uses the PiPicoMite02_Digio32 library
CircuitPython SD Card
- Adafruit CircuitPython Module Install
- Code Storage on SD Card
- SDCard_Dir.py - List SD Card directory
- Pins (from MMBASIC)
# OPTION SDCARD GP13, GP10, GP11, GP12 # CS = GP13 # SCK = GP10 # MOSI = GP11 # MISO = GP12 spi = busio.SPI(board.GP10, MOSI=board.GP11, MISO=board.GP12) cs = board.GP13 sdcard = sdcardio.SDCard(spi, cs)
- Make directories
>>> os.mkdir('/sd/CircuitPython/') >>> os.mkdir('/sd/CircuitPython/SD_Card')
- Add code to path
>>> import sys >>> sys.path ['', '/', '.frozen', '/lib'] >>> sys.path.append("/sd") >>> sys.path ['', '/', '.frozen', '/lib', '/sd'] >>> os.listdir('/sd/CircuitPython/SD_Card') []
Factory Test
- Test cards using this procedure
- MMBASIC is already set up on the card
Equipment
- Unit Under Test (UUT)
- VGA monitor
- Stereo amplified speakers
- PS/2 keyboard
- MBASIC SD card with contents
- Raspberry Pi Pico
- PC running TeraTerm
- If optional port expander is installed
Test SD card interface
- Type
files
- Returns
A:/ <DIR> basic <DIR> bmps <DIR> demos <DIR> games <DIR> jpegs <DIR> lbcards <DIR> performance <DIR> wave 8 directories, 0 files
Test Sound
- Type
chdir "/wave" play wav "sample4.wav"
- Sound should come out of speakers
- Stop with
play stop
Test GPIO (optional (2) MCP23017 are installed)
- GPIO32-01.bas - Test program
- Connect LED-32 card to P1 via DB37RIBBON card and cable
- Type
> chdir "/lbcards/GPIO32" >load "GPIO32-01.bas" >run Looping through LEDs Hit a key to stop
- LEDs will blink
- Any key will stop the program
flash save 3
PiPicoMite02 P1 to LED-32 wiring
- PiPicoMite02 P1 is a female connector
- Use DB37RIBBON to convert to right angle header pins
- LED-32 has a 40-pin right angle header pins
- Cable has (2) of 2x10 Dupont housings at each end
- Wiring
P1 | Chip | Port | Bit | DB37RIB | LED | LED-32 pin | Color | P1 | Chip | Port | Bit | DB37RIB | LED | LED-32 pin | Color | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | GND | 1 | 39 | BLK | 20 | GND | 2 | 40 | BLK | |||||||
2 | 0 | B | 7 | 3 | D15 | 35 | WHT | 21 | 0 | A | 0 | 4 | D31 | 36 | BRN | |
3 | 0 | B | 6 | 5 | D14 | 33 | GRY | 22 | 0 | A | 1 | 6 | D30 | 34 | ORA | |
4 | 0 | B | 5 | 7 | D13 | 31 | VIO | 23 | 0 | A | 2 | 8 | D29 | 32 | YEL | |
5 | 0 | B | 4 | 9 | D12 | 29 | BLU | 24 | 0 | A | 3 | 10 | D28 | 30 | GRN | |
6 | 0 | B | 3 | 11 | D11 | 27 | GRN | 25 | 0 | A | 4 | 12 | D27 | 28 | BLU | |
7 | 0 | B | 2 | 13 | D10 | 25 | YEL | 26 | 0 | A | 5 | 14 | D26 | 26 | VIO | |
8 | 0 | B | 1 | 15 | D9 | 23 | ORA | 27 | 0 | A | 6 | 16 | D25 | 24 | GRY | |
9 | 0 | B | 0 | 17 | D8 | 21 | BRN | 28 | 0 | A | 7 | 18 | D24 | 22 | WHT | |
10 | N/C | 19 | 29 | 1 | B | 7 | 20 | D23 | 20 | WHT | ||||||
11 | 1 | A | 0 | 21 | D0 | 5 | BRN | 30 | 1 | B | 6 | 22 | D22 | 18 | GRY | |
12 | 1 | A | 1 | 23 | D1 | 7 | ORA | 31 | 1 | B | 5 | 24 | D21 | 16 | VIO | |
13 | 1 | A | 2 | 25 | D2 | 9 | YEL | 32 | 1 | B | 4 | 26 | D20 | 14 | BLU | |
14 | 1 | A | 3 | 27 | D3 | 11 | GRN | 33 | 1 | B | 3 | 28 | D19 | 12 | GRN | |
15 | 1 | A | 4 | 29 | D4 | 13 | BLU | 34 | 1 | B | 2 | 30 | D18 | 10 | YEL | |
16 | 1 | A | 5 | 31 | D5 | 15 | VIO | 35 | 1 | B | 1 | 32 | D17 | 8 | ORA | |
17 | 1 | A | 6 | 33 | D6 | 17 | GRY | 36 | 1 | B | 0 | 34 | D16 | 6 | BRN | |
18 | 1 | A | 7 | 35 | D7 | 19 | WHT | 37 | +3.3V | 36 | D15 | |||||
19 | +3.3V | 37 |
Test I2C header (RTC)
- Use DS1307 RTC (ebay search) attached to I2C J1
- J1 I2C0SCL wired to RTC SCL
- J1 I2C0SDA wired to RTC SDA
- J1 VCC wired to RTC VCC
- J1 GND wired to RTC GND
- If RTC is not configured, type
option system i2c gp0, gp1 rtc settime YYYY, MM, DD, HH, MM, SS
- Check time
rtc gettime print time$
- Verify RTC time works
Test 5V in
- Connect USB B to 5V (or PC)
- Remove USB Micro cable
- Card should continue to run
Mechanicals
Issues
Rev 1
- No issues