PiPicoMite02

From Land Boards Wiki
Revision as of 14:22, 17 June 2022 by Blwikiadmin (talk | contribs)
Jump to navigation Jump to search

PiPicoMite-02 P18268 720px.jpg

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 expander
    • 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
  • 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

PiPico Pins.PNG

Pin Marking on Rear

PiPicoMite02 REAR 3D.png

Schematic

Connectors

PicoMite02 Rev1 CAD.PNG

J1 - I2C (RTC, etc.)

PiPicoMite02 J1 I2C.PNG

  1. INT (GP3)
  2. SCL (GP1)
  3. SDA (GP0)
  4. VCC
  5. 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

PiPicoMite02 J2-3.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- MCP23017s - I2C Interrupt 2

PiPicoMite02 J4 I2C-Interrupt.PNG

  • Install jumper to connect INTA interrupts from MCP23017s to GP2 on Pico
  • No Pull-up

J5 - I2C2 Terminators

PiPicoMite02 J5 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

J6 - 3.3V Power Out

PiPicoMite02 J6 3p3V.PNG

J7 - 5V Input

PiPicoMite02 J7 5V.PNG

  • Useful for external 5V

J8 - Audio

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

PiPicoMite02 J8 Audio.PNG

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.

PiPicoMite02 J9 VGA.PNG

J10 - USB B Power Connectors

PiPicoMite01 J10 5V-Power.PNG

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

PiPicoMite01 J11 Keyboard.PNG

P1 - 32-bit GPIO

PiPicoMite02 P1 GPIO.PNG

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

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

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

Factory Test

Equipment

  • Unit Under Test (UUT)
  • VGA monitor
  • Stereo amplified speakers
  • PS/2 keyboard
  • MBASIC SD card with contents from GitHub repo
  • Raspberry Pi Pico
  • PC running TeraTerm

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

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)

> 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

Test I2C header

  • Connect DS1307 RTC to J1
  • Type
rtc gettime
print time$

Test 5V in

  • Connect USB B to 5V (or PC)
  • Remove USB Micro cable
  • Card should continue to run

Issues

Rev 1

  • No issues

Assembly Sheet