PiPicoMite02

From Land Boards Wiki
Revision as of 22:09, 22 May 2022 by Blwikiadmin (talk | contribs) (Created page with "file:PiPicoMite02_FRONT_3D.png == Features == * Raspberry Pi Pico ** All pins brought to header ** Pin marking on rear * VGA (1:2:1 - R:G:B) - 16 colors * PS/2 Keybo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

PiPicoMite02 FRONT 3D.png

Features

  • Raspberry Pi Pico
    • All pins brought to header
    • Pin marking on rear
  • VGA (1:2:1 - R:G:B) - 16 colors
  • 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
  • Stereo audio
    • 3.5mm jack
  • 16-bit GPIO
    • MCP23017 port expander
    • I2C1
    • 2x10 0.1" pitch header
    • Jumper selectable terminators
  • Power options
    • 5V power input via USB B or 0.1" pitch header
    • 3.3V output header
  • 120mmx70mm outline
  • (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

PiPico Pins.PNG

Pin Marking on Rear

PiPicoMite01 REAR 3D.png

Schematic

Connectors

H1 - I2C2 Terminators

PiPicoMite01 H1 I2CTerms.PNG

  • 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

J1 - MCP23017 - I2C Interrupt

PiPicoMite01 J1 I2C-Interrupt.PNG

  • Install jumper to connect INTA interrupt from MCP23008 to GP2 on Pico
  • No Pull-up

J2 - USB B Power Connectors

PiPicoMite01 J2 5V-Power.PNG

  • Full size USB B connector
  • No USB signal connections, just used for power

J3/J5 Pico Connectors

PiPicoMite01 J4-5 PiPico.PNG

Pico Function Mapping

GP FUNCTION PICO PIN GP FUNCTION PICO PIN
GP0 I2C1_INT (MCP23017) 1 GP16 VGA_HSYNC 21
GND AUDIO-GND 8 GP17 VGA_VSYNC 22
GP6 AUDIO-L 9 GP18 VGA_BLU 24
GP7 AUDIO-R 10 GP19 VGA_GRN_LO 25
GP8 PS2_CLK 11 GP20 VGA_GRN_HI 26
GP9 PS2_DATA 12 GP21 VGA_RED 27
GP10 SD_SCK 14 VSYS PS2_5V 39
GP11 SD_MOSI 15 3.3V PS2_3.3V
GP12 SD_MISO 16 3.3V SD_3.3V
GP13 SD_SLVSEL 17
GP14 I2C1_SDA (MCP23017) 19
GP15 I2C1_SCL (MCP23017) 20

J4 - 5V Input

PiPicoMite01 J9 5V.PNG

  • Useful for external 5V

J6 - 3.3V Power Out

PiPicoMite01 H1 3p3V.PNG

J7 - Audio

OPTION AUDIO GP6, GP7
PLAY WAV "file.wav"

PiPicoMite01 J7 Audio.PNG

J8 - 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.

PiPicoMite01 J8 Keyboard.PNG

J9 - GPIO

File:PiPicoMite01 J6 GPIO.PNG

SetPin GP14, GP15, I2C2
I2C2 OPEN 400, 100
I2C2 WRITE &H20, 0, 2, &H00, &H00
I2C2 WRITE &H20, 0, 2, &H01, &H00

J10 - 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.

PiPicoMite01 P1 VGA.PNG

J11 - I2C (RTC, etc.)

PiPicoMite01 J11 I2C.PNG

  1. SCL (GP1)
  2. SDA (GP0)
  3. VCC
  4. GND

Can use Real Time Clocks using the PCF8563, DS1307, DS3231 or DS3232 chips means that the time is always accurately known.

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

PiPicoMite01 J1 SD Card.PNG

Prototype Build

PicoMite Proto P18159 720px.jpg

OPTION (Configuration)

  • List options
OPTION LIST
  • Setup options
OPTION KEYBOARD US
OPTION SDCARD GP13, GP10, GP11, GP12
OPTION AUDIO GP6, GP7
OPTION COLOURCODE ON
  • Clear OPTIONS with
OPTION RESET

Raspberry Pi Pico in a Small Plastic Project Box

Pico Plastic Box P18136 720px.jpg

VGAX49

VGAX49 P901-cropped-720px.jpg

  • VGAX49
  • Resistors Values
    • Selected for 0.7V output on analog RGB pins
    • R12 = 270
    • R6 = 390
    • R7 = 820
    • R1 = 270
R,B G RES G
Rs 75 R1 390 75
Rm 270 R2 820 264.298
Vin 3.3 RM 264.298 3.3
Vout 0.717 0.729
I (mA) 9.57 I (mA) 9.73

PS2X49

PS2X49 P897 cropped 512pxV.jpg

  • PS2X49
  • PWR1 is the power to the PS/2 #1, #2 connectors (5V)
  • +3.3V powers the TXS0104 translator
  • Routing
    • CLK1, DAT1 on J3 go to J1 (Purple)
    • CLK2, DAT2 on J3 go to J2 (Not used)

J3-schem.PNG

SD CARD X49

SDCARDX49 P935 cropped-512px.jpg

  • SD CARD X49
  • Install NO5V jumper
  • Connect 3.3V power
  • No 5V attached
  • No U2 voltage regulator needed

GRID49 - Audio Filter

PiceMite VGA Audio.PNG

GRID49 AUDIO.png

  • C1 = Audio_In-L
  • D1 - GND
  • E1 - Audio_In-R

AUDIO SIM.PNG

Cabling

FUNCTION GP PICO PIN CARD SIG PIN COLOUR
I2C1GND GND 3 MCP23017
AUDIO-GND GND 8 GRID49 AUD-GND D1 BLK
AUDIO-L GP6 9 GRID49 AUD-L C1 VIO
AUDIO-R GP7 10 GRID49 AUD-R E1 YEL
PS2_CLK GP8 11 PS2X49 CLK1 6 VIO
PS2_DATA GP9 12 PS2X49 DAT1 8 YEL
PS2_GND GND 13 PS2X49 GND 10 BLK
SD_SCK GP10 14 SD_CARD_X49 SCLK 3 VIO
SD_MOSI GP11 15 SD_CARD_X49 MOSI 4 BLU
SD_MISO GP12 16 SD_CARD_X49 MISO 2 YEL
SD_SLVSEL GP13 17 SD_CARD_X49 -SDCS 5 GRY
SD_GND GND 18 SD_CARD_X49 GND 1 BLK
I2C1_SDA GP14 19 MCP23017 SDA YEL
I2C1_SCL GP15 20 MCP23017 SCL WHT
VGA_HSYNC GP16 21 VGA HS 17 GRY
VGA_VSYNC GP17 22 VGA VS 18 WHT
VGA_GND GND 23 VGA GND 19 BRN
VGA_BLU GP18 24 VGA B4 12 BLU
VGA_GRN_LO GP19 25 VGA G4 7 GRN
VGA_GRN_HI GP20 26 VGA G5 6 GRN
VGA_RED GP21 27 VGA R4 1 ORG
PS2_5V VSYS 39 PS2X49 PWR1 2 ORG
PS2_3.3V 3.3V BUS PS2X49 3.3V 4 RED
SD_3.3V 3.3V BUS SD_CARD_X49 3.3V 7 RED

Mechanicals

PicoMite01 Rev1 Mechs.PNG

PicoMite Software

PicoMite Source code

MCP23017 I2C Demo Code

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

Tetris

> memory
Program:
  13K (10%) Program (485 lines)
  95K (90%) Free

RAM:
   8K ( 5%) 31 Variables
   0K ( 0%) General
 132K (95%) Free

Pico Tetris.jpg

Issues

Rev 1

  • SDA, SCL swapped to MCP23017
  • Cut etch solder side U2-12
  • Cut etch solder side U2-13
  • Add wire Pico pin 19 to U2-13 (GP14) (or etch that went to Pico pin 20)
  • Add wire Pico pin 20 to U2-12 (GP15) (or etch that went to Pico pin 19)

PicoMite01 X1 Rework I2C2.PNG

Assembly Sheet