Difference between revisions of "PiPicoMite03"

From Land Boards Wiki
Jump to navigation Jump to search
(Created page with "link=https://www.tindie.com/products/26931/ file:PiPicoMite01_P18182_720px.jpg <video type="youtube">5dcnrLDzjdU</video> == Features == * [...")
 
 
(128 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:tindie-mediums.png|link=https://www.tindie.com/products/26931/]]
+
[[File:tindie-mediums.png|link=https://www.tindie.com/products/land_boards/raspberry-pi-pico-card-with-vga-sound-kbd-v3/]]
  
[[file:PiPicoMite01_P18182_720px.jpg]]
+
* Assembled board will ship as
 +
 
 +
[[file:PiPicoMite03_P18397-720px.jpg]]
  
 
<video type="youtube">5dcnrLDzjdU</video>
 
<video type="youtube">5dcnrLDzjdU</video>
 +
 +
== Card Versions ==
 +
 +
* There are three versions of this card
 +
** [[PiPicoMite01]]
 +
*** Has 16-bit port I/O expander
 +
*** 120x70mm with (4) 6-32 mounting holes
 +
** [[PiPicoMite02]]
 +
*** Has 32-bit port I/O expander(s)
 +
*** 95x95mm with (4) 6-32 mounting holes
 +
** [[PiPicoMite03]] (this version)
 +
*** 99.5x69.5mm - Fits into extruded Aluminum Enclosure
 +
*** Fully functional, reduced cost
  
 
== Features ==
 
== Features ==
  
 
* [[Raspberry Pi Pico]]
 
* [[Raspberry Pi Pico]]
** All Pico pins brought to headers
+
** Spare Pico pins brought to headers
** Pico pin marking on rear
+
*** Spare Pico pin marking on rear
 
* VGA
 
* VGA
 
** [http://www.tinyvga.com/vga-timing/640x480@60Hz 640x480] monochrome resolution
 
** [http://www.tinyvga.com/vga-timing/640x480@60Hz 640x480] monochrome resolution
Line 15: Line 30:
 
** 1:2:1 - R:G:B - 16 colours
 
** 1:2:1 - R:G:B - 16 colours
 
* [https://wiki.osdev.org/PS/2_Keyboard PS/2 Keyboard]
 
* [https://wiki.osdev.org/PS/2_Keyboard PS/2 Keyboard]
** 5V to keyboard with voltage translator
+
** 5V to keyboard with voltage translator on clock/data lines
 
** Does not require a keyboard that runs at 3.3V
 
** Does not require a keyboard that runs at 3.3V
 
* SD Card
 
* SD Card
Line 21: Line 36:
 
** Up to 32GB
 
** Up to 32GB
 
** FAT32 format
 
** FAT32 format
 +
** [https://www.amazon.com/SanDisk-3-Pack-Ultra-Memory-3x32GB/dp/B08GY9575R/ref=sr_1_3?keywords=sandisk%2B32gb%2Bsd%2Bcard&qid=1657457739&sprefix=sandisk%2B32GB%2Caps%2C85&sr=8-3&th=1 Tested/worked]
 
* Stereo audio
 
* Stereo audio
 
** PWM with filter
 
** PWM with filter
 
** 3.5mm jack
 
** 3.5mm jack
* 16-bit General Purpose I/O (GPIO)
+
** [https://www.amazon.com/dp/B000R9AAJA?psc=1&ref=ppx_yo2ov_dt_b_product_details Cheap speakers]
** [https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf MCP23017] port expander
+
* 5V power input on USB B
** On Pico I2C1 (I2C2 from MMBASIC)
+
** Power only (not data)
** 2x10 0.1" pitch header
+
** Measured 40 mA at 5,24V in
** Jumper selectable terminators
+
* 99.5mmx69.5mm outline
* I2C0 connector (Rev 2 and later)
+
** Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=100*76*35mm+aluminum&_sacat=0&LH_TitleDesc=0&_odkw=100*76*35mm+Aluminum+PCB+Instrument+Box+Enclosure+Electronic+Project+Case+Set&_id=174408274566 ebay search]
* Power options
+
** VGA, USB B (Power), 3.5mm Audio on one end
** 5V power input
+
** Keyboard, SD card on the opposite end
*** USB Micro on Pico card
+
* Optional DS1307 Real time Clock (RTC) / Digital Thermometer
*** USB B
+
** On I2C1 bus (I2C2 from MMBASIC)
*** 0.1" pitch header
+
** 27 x 28 x 8.4mm
** 3.3V output header
+
** DS1307 RTC
* 120mmx70mm outline
+
** DS18B20 Digital Thermometer
* (4) 6-32 Mounting holes
 
  
 
=== BASIC Interpreter ===
 
=== 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.
+
The [https://geoffg.net/picomitevga.html 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, originally written by Geoff Graham and enhanced and ported to the Pico by Peter Mather, who also designed the original PicoMite on which thiis design is based. 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.
+
MMBasic is a Microsoft BASIC compatible implementation of the BASIC language, originally written by Geoff Graham and enhanced and ported to the Pico by Peter Mather, who also designed the original PicoMite on which this design is based. 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.
 
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.
Line 49: Line 64:
 
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.
 
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 ==
+
==== MMBASIC Credits ====
 +
 
 +
Peter Mather led the project, ported the MMBasic interpreter to the Raspberry Pi Pico and wrote the hardware device drivers. Geoff Graham wrote the MMBasic interpreter and the manual.  Mick Ames wrote the PIO compiler and its corresponding documentation. The VGA driver code was derived from work by Miroslav Nemecek.
 +
 
 +
=== Raspberry Pi Pico Pinout (Reference) ===
  
 
[[File:PiPico_Pins.PNG]]
 
[[File:PiPico_Pins.PNG]]
  
== Pin Marking on Rear (Rev 2) ==
+
== Pin Marking on Rear ==
  
[[file:PiPicoMite01_REAR_3D.png]]
+
[[file:PiPicoMite03_P18400-720px.jpg]]
  
 
== Schematic ==
 
== Schematic ==
  
* [http://land-boards.com/PiPicoMite01/PiPicoMite01_Rev1_Schematic.pdf PiPicoMite01 Rev 1 Schematic]
+
* [http://land-boards.com/PiPicoMite03/PiPicoMite03_Rev1_Schematic.pdf PiPicoMite03 Rev 1 Schematic]
* [http://land-boards.com/PiPicoMite01/PiPicoMite01_Rev2_Schematic.pdf PiPicoMite01 Rev 2 Schematic]
 
 
 
== Rev 1 Connectors ==
 
  
* [[PiPicoMite01 Rev 1 Connectors]] - Note the Rev 1 connectors are in different sequence orders than the Rev 2 and later cards
+
== Connectors / Headers ==
  
== Rev 2 Connectors ==
+
[[file:PicoMite03_Rev1_CAD.PNG]]
  
* The following are for Rev 2 and later boards
 
  
[[file:PicoMite01_Rev2_CAD.PNG]]
+
=== J1 - VGA ===
 
 
=== J1 - MCP23017 - 16-bit GPIO ===
 
 
 
* [https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf MCP23017 Datasheet]
 
* 2x10 header
 
* Includes (2) power, (2) ground pins
 
* On I2C2 pins (I2C1 on Pico)
 
** SetPin BASIC code
 
 
 
<pre>
 
SetPin GP14, GP15, I2C2
 
</pre>
 
 
 
[[file:PiPicoMite01_J1_GPIO.PNG]]
 
 
 
* Initialization code
 
 
 
<pre>
 
MCP23017_I2CADR  = &H20
 
MCP23017_IODIRA  = &H00
 
MCP23017_IODIRB  = &H01
 
MCP23017_IPOLA    = &H02
 
MCP23017_IPOLB    = &H03
 
MCP23017_GPINTENA = &H04
 
MCP23017_GPINTENB = &H05
 
MCP23017_DEFVALA  = &H06
 
MCP23017_DEFVALB  = &H07
 
MCP23017_INTCONA  = &H08
 
MCP23017_INTCONB  = &H09
 
MCP23017_IOCON    = &H0A
 
MCP23017_GPPUA    = &H0C
 
MCP23017_GPPUB    = &H0D
 
MCP23017_INTFA    = &H0E
 
MCP23017_INTFB    = &H0F
 
MCP23017_INTCAPA  = &H10
 
MCP23017_INTCAPB  = &H11
 
MCP23017_GPIOA    = &H12
 
MCP23017_GPIOB    = &H13
 
MCP23017_OLATA    = &H14
 
MCP23017_OLATB    = &H15
 
 
 
SetPin GP14, GP15, I2C2
 
I2C2 OPEN 400, 100
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_IODIRA, &H00
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_IODIRB, &H00
 
</pre>
 
 
 
* Write alternating patterns
 
 
 
<pre>
 
' Alternating patterns
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_OLATA, &H55
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_OLATB, &HAA
 
Pause 1000
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_OLATA, &HAA
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_OLATB, &H55
 
Pause 200
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_OLATA, &H00
 
I2C2 WRITE MCP23017_I2CADR, 0, 2, MCP23017_OLATB, &H00
 
</pre>
 
 
 
=== J2 - 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.
 
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.
Line 146: Line 99:
 
</pre>
 
</pre>
  
[[file:PiPicoMite01_J2_VGA.PNG]]
+
[[file:PiPicoMite03_J1-VGA.PNG]]
 +
 
 +
=== J2 - USB B Power Connector ===
 +
 
 +
[[file:PiPicoMite03_J2-5V.PNG]]
 +
 
 +
* Full size USB B connector
 +
* No USB signal connections, just used for power
 +
 
 +
=== J3 - PS/2 Keyboard ===
  
=== J3 - 3.3V Power Out ===
+
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.
  
* Power external interfaces
+
* 5V keyboard (VSYS)
* Limits of the [https://www.richtek.com/Products/Switching%20Regulators/Buck-Boost%20Converter/RT6150ART6150B?sc_lang=en&specid=RT6150A/RT6150B RT6150 regulator] on the Pico
 
** [https://components101.com/development-boards/raspberry-pi-pico-pinout-datasheet-specifications Max permissible current is 300mA]
 
  
[[file:PiPicoMite01_J3_3p3V.PNG]]
+
[[file:PiPicoMite03_J3-KBD.PNG]]
  
 
=== J4 - Audio ===
 
=== J4 - Audio ===
Line 171: Line 131:
 
[[file:PiPicoMite01_J4_Audio.PNG]]
 
[[file:PiPicoMite01_J4_Audio.PNG]]
  
=== J5 - USB B Power Connector ===
+
=== H1 - I2C1, RTC ===
  
* In parallel with J6
+
[[FILE:PiPicoMite03_H1-RTC.PNG]]
  
[[file:PiPicoMite01_J5_5V-Power.PNG]]
+
# VBAT (N/C)
 +
# GND
 +
# VCC
 +
# I2C1_SDA (GP14)
 +
# I2C1_SCL (GP15)
 +
# DS (GP5)
 +
# SQ (M/C)
  
* Full size USB B connector
+
==== RTC / Digital Thermometer ====
* No USB signal connections, just used for power
 
  
=== J6 - 5V Input ===
+
* Optional [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=DS1307&_sacat=0&LH_TitleDesc=0&_odkw=100*76*35mm+aluminum&_osacat=0&_id=174408274566 DS1307 Real Time Clocks module]
 +
** DS1307 I2C real time clock chip (RTC)
 +
** 24C32 32K I2C EEPROM memory
 +
** LIR2032 rechargeable Lithium battery with charging circuit
 +
** With new battery, can power DS1307 module for 1 year
 +
** Compact design 27 x 28 x 8.4mm
 +
** Can install DS18B20 digital temperature sensor on module
 +
*** Connects to GP5 pin
  
[[file:PiPicoMite01_J6-5V.PNG]]
+
<pre>
 
+
option system i2c2 gp14, gp15
* Useful to power the card from external 5V
+
</pre>
* Use in place of J5
 
 
 
=== J7 - 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.
 
 
 
* 5V keyboard
 
 
 
[[file:PiPicoMite01_J7_PS2-Keyboard.PNG]]
 
 
 
=== J8 - I2C0, UART0 (RTC, etc.) ===
 
  
[[FILE:PiPicoMite01_J8_I2C.PNG]]
+
[[file:RTC_PartsSide.PNG]]
  
# I2C0SCL. UART0_TX (GP1)
+
* Installs battery side up
# I2C0SDA. UART0_RX (GP0)
 
# VCC
 
# GND
 
  
Can use Real Time Clocks using the PCF8563, DS1307, DS3231 or DS3232 chips means that the time is always accurately known.
+
[[file:RTC_BatterySide.PNG]]
  
<pre>
+
* With RTC installed
option system i2c gp0, gp1
+
* Fits within box with plenty of clearance
</pre>
+
* Can be mounted with either a 7-pin female header or RTC pins soldered directly to board
  
=== J9,J10 Pico Connectors ===
+
[[file:PiPicoMite03_P18408-720px.jpg]]
  
* Pico pins are brought out to 1x20 pin headers J9, J10
+
=== H2-H5 - Pico GVS Connectors ===
  
[[file:PiPicoMite01_J9-10_PiPico.PNG]]
+
* Spare Pico pins are brought out to GVS headers
 +
* Connectors are adjacent for GVS connections via 1x3 Dupont housings
 +
* H2/H3 adjacent to each other
 +
** H3-1 = ADCREF
 +
** H3-2 = GP28
 +
** H3-3 = GP27
 +
** H3-4 = GP26
 +
** H3-5 = RUN
 +
** H3-6 = GP22
 +
* H4/H5 adjacent to each other
 +
** H4-1 = GP5
 +
** H4-2 = GP4
 +
** H4-3 = GP3
 +
** H4-4 = GP2
 +
** H4-5 = GP1
 +
** H5-6 = GP0
  
==== Pico Function Mapping ====
+
[[file:PiPicoMite03_GVS.PNG]]
  
{| class="wikitable"
+
=== SD Card ===
! GP
 
! FUNCTION
 
! PICO PIN
 
!
 
! GP
 
! FUNCTION
 
! PICO PIN
 
|-
 
| GP0
 
| SPARE
 
| 1
 
|
 
| GP16
 
| VGA_HSYNC
 
| 21
 
|-
 
| GP1
 
| SPARE
 
| 2
 
|
 
| GP17
 
| VGA_VSYNC
 
| 22
 
|-
 
| GP2
 
| I2C1_INT (MCP23017)
 
| 4
 
|
 
| GP18
 
| VGA_BLU
 
| 24
 
|-
 
| GP3
 
| SPARE
 
| 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
 
|
 
| GP26
 
| SPARE
 
| 31
 
|-
 
| GP8
 
| PS2_CLK
 
| 11
 
|
 
| GP27
 
| SPARE
 
| 32
 
|-
 
| GP9
 
| PS2_DATA
 
| 12
 
|
 
| GP28
 
| SPARE
 
| 34
 
|-
 
| GP10
 
| SD_SCK
 
| 14
 
|
 
| 3.3V
 
| POWER_3.3V
 
| 36
 
|-
 
| GP11
 
| SD_MOSI
 
| 15
 
|
 
| VSYS
 
| PS2_5V
 
| 39
 
|-
 
| GP12
 
| SD_MISO
 
| 16
 
|
 
|
 
|
 
|
 
|-
 
| GP13
 
| SD_SLVSEL
 
| 17
 
|
 
|
 
|
 
|
 
|-
 
| GP14
 
| I2C1_SDA (MCP23017)
 
| 19
 
|
 
|
 
|
 
|
 
|-
 
| GP15
 
| I2C1_SCL (MCP23017)
 
| 20
 
|
 
|
 
|
 
|
 
|-
 
|}
 
 
 
=== 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.
 
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.
Line 367: Line 201:
 
</pre>
 
</pre>
  
[[file:PiPicoMite01_J1_SD_Card.PNG]]
+
[[file:PiPicoMite03_SD1-SDCARD.PNG]]
 
 
=== H1 - I2C Terminators ===
 
 
 
[[file:PiPicoMite01_H1_I2CTerms.PNG]]
 
 
 
* 2.2K terminators
 
* Install shunts to terminate SDA, SCL signals that go to the on-board MCP23017 I2C Expander
 
* Terminators are normally installed at the end of daisy-chained cards
 
* I2C1 on Raspberry Pi Pico pins
 
* I2C2 from MM BASIC
 
* MM BASIC example commands
 
<pre>
 
SETPIN GP14, GP15, I2C2
 
I2C2 OPEN 400, 100
 
I2C2 WRITE &H20, OC, LEN, B0[, B1...]
 
I2C2 READ &H20, OX, LEN, BUFF()
 
</pre>
 
* &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
 
 
 
=== H2 - MCP23017 - I2C Interrupt ===
 
 
 
[[file:PiPicoMite01_H2_I2C-Interrupt.PNG]]
 
 
 
* Install shunt to connect INTA interrupt from MCP23017 to GP2 on Pico
 
* MCP23017 interrupts can be set to generate interrupts on INTA pins for both A abd B ports
 
* No Pull-up on card
 
  
 
== Configuration Options ==
 
== Configuration Options ==
Line 406: Line 210:
 
OPTION KEYBOARD US
 
OPTION KEYBOARD US
 
OPTION SDCARD GP13, GP10, GP11, GP12
 
OPTION SDCARD GP13, GP10, GP11, GP12
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
+
OPTION AUDIO GP6, GP7, ON PWM CHANNEL 3
option system i2c gp0, gp1
+
OPTION SYSTEM I2C GP14, GP15
 
</pre>
 
</pre>
  
== Prototype Build ==
+
== PicoMiteVGA Software ==
  
* [[Raspberry Pi Pico MM BASIC Build]]
+
=== Download MMBASIC ===
* Built from Land Boards cards
 
  
[[file:PicoMite_Proto_P18159_720px.jpg]]
+
* Tested with "VGA only" versions
 +
** Released [https://geoffg.net/Downloads/picomite/PicoMiteVGA_Firmware.zip V5.07.04]
 +
** Beta [https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=14854#186644 V5.07.05b2]
 +
** [https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/PicoMiteVGA_Firmware Copies of firmware versions] - some have unstable video mode 1
 +
* [https://www.thebackshed.com/forum/ViewTopic.php?TID=14854&P=1 TheBackshed forum] - support
 +
* If the Pico does not already have MMBASIC installed
 +
* Hold button on Pico while plugging in USB Micro to PC
 +
* Drive will open
 +
* Drop VGA uf2 onto Drive
 +
* System will reboot
  
== Mechanicals ==
+
<pre>
 +
> print mm.ver
 +
5.070502
 +
</pre>
  
[[file:PicoMite01_Rev2_Mechs.PNG]]
+
* Run TeraTerm
 +
** Connect to Serial
  
== PicoMite Software ==
+
=== Configure MMBASIC ===
  
<video type="youtube">BFAmXNDGFA0</video>
+
* Setups
 +
** Can copy-paste a line at a time into TeraTerm
 +
** Some options will reboot the card
 +
<pre>
 +
OPTION SDCARD GP13, GP10, GP11, GP12
 +
OPTION AUDIO GP6, GP7
 +
OPTION SYSTEM I2C GP14, GP15
 +
OPTION COLOURCODE ON
 +
OPTION KEYBOARD US
 +
</pre>
 +
* Remove USB power
 +
* Install SD card
 +
* Apply USB power
  
 
=== PicoMite Source code ===
 
=== PicoMite Source code ===
Line 430: Line 258:
 
** [https://github.com/UKTailwind/PicoMite-VGA-Edition Extra/replacement files for VGA]
 
** [https://github.com/UKTailwind/PicoMite-VGA-Edition Extra/replacement files for VGA]
  
==== MCP23017 on external cards ====
+
== CircuitPython on PiPicoMite0x Cards ==
 
 
* [http://land-boards.com/blwiki/index.php?title=PROTO16-I2C PROTO16-I2C card]
 
* [https://github.com/land-boards/RasPiPico/blob/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/lbcards/GPIO16/GPIO16-02.bas GPIO16-02.bas]
 
** Set all 16 GPIO pins as outputs
 
** Write alternate patterns, bounce a 1 across the outputs
 
* On [[SWLEDX8-I2C]] card
 
** [https://github.com/land-boards/RasPiPico/blob/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/lbcards/SWLEDX8/swledx8-03.bas swledx8-03.bas]
 
** Read switches, write LEDs
 
 
 
=== MCP23008 Demo Code ===
 
 
 
* [https://ww1.microchip.com/downloads/en/DeviceDoc/MCP23008-MCP23S08-Data-Sheet-20001919F.pdf MCP23008 Datasheet]
 
 
 
==== I2CIO-8 card ====
 
  
* [[I2CIO-8]] card
+
* The PiPicoMite0x cards can run CircuitPython with some limitations
* [https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/lbcards/I2CIO8 MMBASIC code] - GitHub repo
+
* Card features for CircuitPython application
** [https://github.com/land-boards/RasPiPico/blob/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/lbcards/I2CIO8/I2CIO8_Test.bas I2CIO8_Test.bas] - Card Test program
+
** SD support
 +
** 5V input
 +
** External I2C
 +
* CircuitPython does not have built-in support for
 +
** VGA
 +
** PS/2
 +
** Audio
  
== MMBASIC vs MicroPython Performance ==
+
== Factory Test Procedure ==
  
<video type="youtube">VFdXTYLX6PU</video>
+
* Test assembled cards using this procedure
 
+
* MMBASIC is already set up on the card
== Factory Test ==
 
  
 
=== Equipment ===
 
=== Equipment ===
Line 462: Line 281:
 
* Stereo amplified speakers
 
* Stereo amplified speakers
 
* PS/2 keyboard
 
* PS/2 keyboard
* MBASIC SD card
+
* MMBASIC SD card with contents
* Raspberry Pi Pico
+
** [https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs Test Software repo]
* PC running TeraTerm
+
* Raspberry Pi Pico with MMBASIC installed
 +
* PC running [http://www.teraterm.org/ TeraTerm]
  
=== Download MMBASIC ===
+
=== Test SD card interface ===
 
 
* 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
 
<pre>
 
OPTION SDCARD GP13, GP10, GP11, GP12
 
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
 
OPTION COLOURCODE ON
 
</pre>
 
* Remove USB power
 
* Install SD card
 
* Apply USB power
 
 
 
==== Test SD card interface ====
 
  
 
* Type
 
* Type
Line 511: Line 306:
 
</pre>
 
</pre>
  
==== Test Sound ====
+
=== Test Sound ===
  
 +
* Loads [https://github.com/land-boards/RasPiPico/blob/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/wave/sample4.wav sample4.wav file]
 
* Type
 
* Type
 +
 
<pre>
 
<pre>
 
chdir "/wave"
 
chdir "/wave"
 
play wav "sample4.wav"
 
play wav "sample4.wav"
 +
 
</pre>
 
</pre>
 +
 
* Sound should come out of speakers
 
* Sound should come out of speakers
 
* Stop with
 
* Stop with
 +
 
<pre>
 
<pre>
 
play stop
 
play stop
 +
 
</pre>
 
</pre>
  
==== Test GPIO (Rev 2 card) (optional MCP23017 is installed) ====
+
=== Test Keyboard ===
 +
 
 +
* Type on keyboard
 +
* Verify keys show up on VGA
 +
 
 +
=== Test VGA ===
  
* Connect [[LED-32]] card to J1
 
 
* Type
 
* Type
 +
 
<pre>
 
<pre>
chdir "/lbcards/GPIO16"
+
chdir "/demos"
> load "MCP23017_BLINKEY.BAS"
+
load "Colours.bas"
> run
+
run
Blink a bit on the On-board MCP23017 PORTA Bit 0
+
 
Hit a key to stop
 
</pre>
 
* Single LED will blink
 
* Any key will stop the program
 
<pre>
 
flash save 1
 
 
</pre>
 
</pre>
 +
 +
* Verify 16 distinct colors on VGA
 
* Type
 
* Type
 +
 
<pre>
 
<pre>
>load "gpio16-01.bas"
+
mode 1
>run
+
 
Looping through LEDs
 
Hit a key to stop
 
</pre>
 
* LEDs will blink
 
* Any key will stop the program
 
<pre>
 
flash save 2
 
 
</pre>
 
</pre>
  
==== Test 5V in ====
+
=== Test 5V in ===
  
 
* Connect USB B to 5V (or PC)
 
* Connect USB B to 5V (or PC)
Line 559: Line 355:
 
* Card should continue to run
 
* Card should continue to run
  
==== Test I2C ====
+
=== Test I2C (Optional) ===
  
 
* Use DS1307 RTC attached to I2C J1
 
* Use DS1307 RTC attached to I2C J1
  
 
<pre>
 
<pre>
option system i2c gp0, gp1
+
option system i2c gp14, gp15
 +
rtc gettime
 +
print time$
 +
</pre>
 +
 
 +
=== Combined Copy/Paste ===
 +
 
 +
* Above tests can be copy/pasted
 +
 
 +
<pre>
 +
files
 +
 
 +
chdir "/demos"
 +
load "Colours.bas"
 +
run
 +
chdir "/wave"
 +
play wav "sample4.wav"
 +
 
 +
play stop
 +
 
 +
mode 1
 +
 
 +
option system i2c gp14, gp15
 
rtc gettime
 
rtc gettime
 
print time$
 
print time$
 
</pre>
 
</pre>
 +
 +
== Enclosure ==
 +
 +
* Panel cutouts
 +
** [https://github.com/land-boards/lb-boards/blob/master/Raspberry%20Pi%20Cards/PiPicoMite03/Pics/Conns/PiPicoMite03_Panel_Cutouts.pdf PiPicoMite03 Panel Cutouts] pdf file
 +
** Print and use to cut the panel holes
 +
 +
[[file:PiPicoMite03_PanelCutouts.PNG]]
 +
 +
* 99.5mmx69.5mm outline
 +
** Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=100*76*35mm+aluminum&_sacat=0&LH_TitleDesc=0&_odkw=100*76*35mm+Aluminum+PCB+Instrument+Box+Enclosure+Electronic+Project+Case+Set&_id=174408274566 ebay search]
 +
** VGA, USB B (Power), 3.5mm Audio on one end
 +
** Keyboard, SD card on the opposite end
 +
 +
[[file:PiPicoMite03_Enclosure.PNG]]
 +
 +
* Enclosure cross-section
 +
 +
[[file:PiPicoMite03_Enclosure_Mechs.PNG]]
 +
 +
=== 3D Printable End Panels ===
 +
 +
* [https://www.printables.com/model/395379-pipicomite03-picomitevga-end-panels 3D End Panels]
 +
* Credit to [https://www.printables.com/social/171430-rfinnie/about customer]
 +
 +
[[file:pipicomite03-panels.png]]
 +
 +
[[file:pipicomite03-panel-ps2-end.png]]
 +
 +
== Mechanicals ==
 +
 +
* Dimensions to approx. connector centers (and SD adapter slot)
 +
* Enclosure fits 70mmx100mm card
 +
** The PiPicoMite03 card is slightly undersized (0.5mm)
 +
** Still fit in slots but allows for some enclosure mechanical variances
 +
 +
[[file:PicoMite03_Rev1_MECHS.PNG]]
  
 
== Issues ==
 
== Issues ==
Line 573: Line 428:
 
=== Rev 1 ===
 
=== Rev 1 ===
  
* Not yet ordered
+
* Tested, working, no issues
  
 
== Assembly Sheet ==
 
== Assembly Sheet ==
  
* Make sure you build with the current revision assembly sheet
 
** Revision is marked on the rear of the card
 
 
* [[PiPicoMite03 Rev1 Assembly Sheet]]
 
* [[PiPicoMite03 Rev1 Assembly Sheet]]
 +
* [http://land-boards.com/PiPicoMite03/PiPicoMite03_Rev1_ibom.html PiPicoMite03 Rev 1 Interactive BOM]

Latest revision as of 19:10, 20 March 2023

Tindie-mediums.png

  • Assembled board will ship as

PiPicoMite03 P18397-720px.jpg

Card Versions

  • There are three versions of this card
    • PiPicoMite01
      • Has 16-bit port I/O expander
      • 120x70mm with (4) 6-32 mounting holes
    • PiPicoMite02
      • Has 32-bit port I/O expander(s)
      • 95x95mm with (4) 6-32 mounting holes
    • PiPicoMite03 (this version)
      • 99.5x69.5mm - Fits into extruded Aluminum Enclosure
      • Fully functional, reduced cost

Features

  • Raspberry Pi Pico
    • Spare Pico pins brought to headers
      • Spare 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 on clock/data lines
    • Does not require a keyboard that runs at 3.3V
  • SD Card
  • Stereo audio
  • 5V power input on USB B
    • Power only (not data)
    • Measured 40 mA at 5,24V in
  • 99.5mmx69.5mm outline
    • Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - ebay search
    • VGA, USB B (Power), 3.5mm Audio on one end
    • Keyboard, SD card on the opposite end
  • Optional DS1307 Real time Clock (RTC) / Digital Thermometer
    • On I2C1 bus (I2C2 from MMBASIC)
    • 27 x 28 x 8.4mm
    • DS1307 RTC
    • DS18B20 Digital Thermometer

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, originally written by Geoff Graham and enhanced and ported to the Pico by Peter Mather, who also designed the original PicoMite on which this design is based. 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.

MMBASIC Credits

Peter Mather led the project, ported the MMBasic interpreter to the Raspberry Pi Pico and wrote the hardware device drivers. Geoff Graham wrote the MMBasic interpreter and the manual. Mick Ames wrote the PIO compiler and its corresponding documentation. The VGA driver code was derived from work by Miroslav Nemecek.

Raspberry Pi Pico Pinout (Reference)

PiPico Pins.PNG

Pin Marking on Rear

PiPicoMite03 P18400-720px.jpg

Schematic

Connectors / Headers

PicoMite03 Rev1 CAD.PNG


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

Mode 1 (640x480 monochrome) and mode 2 (320x240 16-colours).

OPTION COLOURCODE ON

PiPicoMite03 J1-VGA.PNG

J2 - USB B Power Connector

PiPicoMite03 J2-5V.PNG

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

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

  • 5V keyboard (VSYS)

PiPicoMite03 J3-KBD.PNG

J4 - Audio

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

PiPicoMite01 J4 Audio.PNG

H1 - I2C1, RTC

PiPicoMite03 H1-RTC.PNG

  1. VBAT (N/C)
  2. GND
  3. VCC
  4. I2C1_SDA (GP14)
  5. I2C1_SCL (GP15)
  6. DS (GP5)
  7. SQ (M/C)

RTC / Digital Thermometer

  • Optional DS1307 Real Time Clocks module
    • DS1307 I2C real time clock chip (RTC)
    • 24C32 32K I2C EEPROM memory
    • LIR2032 rechargeable Lithium battery with charging circuit
    • With new battery, can power DS1307 module for 1 year
    • Compact design 27 x 28 x 8.4mm
    • Can install DS18B20 digital temperature sensor on module
      • Connects to GP5 pin
option system i2c2 gp14, gp15

RTC PartsSide.PNG

  • Installs battery side up

RTC BatterySide.PNG

  • With RTC installed
  • Fits within box with plenty of clearance
  • Can be mounted with either a 7-pin female header or RTC pins soldered directly to board

PiPicoMite03 P18408-720px.jpg

H2-H5 - Pico GVS Connectors

  • Spare Pico pins are brought out to GVS headers
  • Connectors are adjacent for GVS connections via 1x3 Dupont housings
  • H2/H3 adjacent to each other
    • H3-1 = ADCREF
    • H3-2 = GP28
    • H3-3 = GP27
    • H3-4 = GP26
    • H3-5 = RUN
    • H3-6 = GP22
  • H4/H5 adjacent to each other
    • H4-1 = GP5
    • H4-2 = GP4
    • H4-3 = GP3
    • H4-4 = GP2
    • H4-5 = GP1
    • H5-6 = GP0

PiPicoMite03 GVS.PNG

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

PiPicoMite03 SD1-SDCARD.PNG

Configuration Options

> OPTION LIST
OPTION COLOURCODE ON
OPTION KEYBOARD US
OPTION SDCARD GP13, GP10, GP11, GP12
OPTION AUDIO GP6, GP7, ON PWM CHANNEL 3
OPTION SYSTEM I2C GP14, GP15

PicoMiteVGA Software

Download MMBASIC

  • Tested with "VGA only" versions
  • TheBackshed forum - support
  • If the Pico does not already have MMBASIC installed
  • Hold button on Pico while plugging in USB Micro to PC
  • Drive will open
  • Drop VGA uf2 onto Drive
  • System will reboot
> print mm.ver
 5.070502
  • Run TeraTerm
    • Connect to Serial

Configure MMBASIC

  • Setups
    • Can copy-paste a line at a time into TeraTerm
    • Some options will reboot the card
OPTION SDCARD GP13, GP10, GP11, GP12
OPTION AUDIO GP6, GP7
OPTION SYSTEM I2C GP14, GP15
OPTION COLOURCODE ON
OPTION KEYBOARD US
  • Remove USB power
  • Install SD card
  • Apply USB power

PicoMite Source code

CircuitPython on PiPicoMite0x Cards

  • The PiPicoMite0x cards can run CircuitPython with some limitations
  • Card features for CircuitPython application
    • SD support
    • 5V input
    • External I2C
  • CircuitPython does not have built-in support for
    • VGA
    • PS/2
    • Audio

Factory Test Procedure

  • Test assembled 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
  • MMBASIC SD card with contents
  • Raspberry Pi Pico with MMBASIC installed
  • PC running TeraTerm

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

chdir "/wave"
play wav "sample4.wav"

  • Sound should come out of speakers
  • Stop with
play stop

Test Keyboard

  • Type on keyboard
  • Verify keys show up on VGA

Test VGA

  • Type
chdir "/demos"
load "Colours.bas"
run

  • Verify 16 distinct colors on VGA
  • Type
mode 1

Test 5V in

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

Test I2C (Optional)

  • Use DS1307 RTC attached to I2C J1
option system i2c gp14, gp15
rtc gettime
print time$

Combined Copy/Paste

  • Above tests can be copy/pasted
files

chdir "/demos"
load "Colours.bas"
run
chdir "/wave"
play wav "sample4.wav"

play stop

mode 1

option system i2c gp14, gp15
rtc gettime
print time$

Enclosure

PiPicoMite03 PanelCutouts.PNG

  • 99.5mmx69.5mm outline
    • Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - ebay search
    • VGA, USB B (Power), 3.5mm Audio on one end
    • Keyboard, SD card on the opposite end

PiPicoMite03 Enclosure.PNG

  • Enclosure cross-section

PiPicoMite03 Enclosure Mechs.PNG

3D Printable End Panels

Pipicomite03-panels.png

Pipicomite03-panel-ps2-end.png

Mechanicals

  • Dimensions to approx. connector centers (and SD adapter slot)
  • Enclosure fits 70mmx100mm card
    • The PiPicoMite03 card is slightly undersized (0.5mm)
    • Still fit in slots but allows for some enclosure mechanical variances

PicoMite03 Rev1 MECHS.PNG

Issues

Rev 1

  • Tested, working, no issues

Assembly Sheet