Difference between revisions of "PiPicoMite02"

From Land Boards Wiki
Jump to navigation Jump to search
(28 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
[[file:PiPicoMite-02_P18268_720px.jpg]]
 
[[file:PiPicoMite-02_P18268_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]] (this version)
 +
*** Has 32-bit port I/O expander(s)
 +
*** 95x95mm with (4) 6-32 mounting holes
 +
** [[PiPicoMite03]]
 +
*** 99.5x69.5mm - Fits into extruded Aluminum Enclosure
 +
*** Fully functional, reduced cost
  
 
== Features ==
 
== Features ==
Line 19: Line 32:
 
** 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
 +
** [https://www.amazon.com/dp/B000R9AAJA?psc=1&ref=ppx_yo2ov_dt_b_product_details Cheap speakers]
 
* 32-bit GPIO
 
* 32-bit GPIO
 
** 2x[https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf MCP23017] port expanders
 
** 2x[https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf MCP23017] port expanders
Line 40: Line 55:
 
=== 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. 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 48: Line 63:
 
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]]
Line 563: Line 582:
  
 
[[file:PiPicoMite01_J1_SD_Card.PNG]]
 
[[file:PiPicoMite01_J1_SD_Card.PNG]]
 +
 +
== Configuration Options ==
 +
 +
<pre>
 +
> 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 gp0, gp1
 +
</pre>
  
 
== PicoMiteVGA Software ==
 
== PicoMiteVGA Software ==
Line 572: Line 602:
 
** Beta [https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=14854#186644 V5.07.05b2]
 
** 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://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
 
* If the Pico does not already have MMBASIC installed
 
* Hold button on Pico while plugging in USB Micro to PC
 
* Hold button on Pico while plugging in USB Micro to PC
Line 593: Line 624:
 
<pre>
 
<pre>
 
OPTION SDCARD GP13, GP10, GP11, GP12
 
OPTION SDCARD GP13, GP10, GP11, GP12
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
+
OPTION AUDIO GP6, GP7
 
OPTION COLOURCODE ON
 
OPTION COLOURCODE ON
 +
OPTION POWER PWM
 +
 
</pre>
 
</pre>
 
* Remove USB power
 
* Remove USB power
Line 606: Line 639:
 
** [https://github.com/UKTailwind/PicoMite-VGA-Edition Extra/replacement files for VGA]
 
** [https://github.com/UKTailwind/PicoMite-VGA-Edition Extra/replacement files for VGA]
  
=== On-Board MCP23017 Example Code ===
+
=== On-Board 32-bit Port Expanders Example Code ===
 +
 
 +
[https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/On-Board_Digital_IO/PiPicoMite02 Example code] that uses the (2) MCP23017 Port Expanders on the card
  
 
* [https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf MCP23017 Datasheet]
 
* [https://ww1.microchip.com/downloads/en/devicedoc/20001952c.pdf MCP23017 Datasheet]
* [https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs/On-Board_Digital_IO/PiPicoMite02 Example code] that uses the (2) MCP23017 Port Expanders on the card
 
  
 
==== GPIO32-01.bas ====
 
==== GPIO32-01.bas ====
Line 623: Line 657:
 
** Provides Arduino style [https://www.arduino.cc/reference/en/language/functions/digital-io/digitalread/ DigitalRead], [https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/ DigitalWrite], [https://www.arduino.cc/reference/en/language/functions/digital-io/pinmode/ PinMode] functions
 
** Provides Arduino style [https://www.arduino.cc/reference/en/language/functions/digital-io/digitalread/ DigitalRead], [https://www.arduino.cc/reference/en/language/functions/digital-io/digitalwrite/ DigitalWrite], [https://www.arduino.cc/reference/en/language/functions/digital-io/pinmode/ PinMode] functions
  
=== External MCP23017 I2C Demo Code ===
+
=== Land Boards Card Test Code ===
 +
 
 +
==== External MCP23017 I2C Demo Code ====
  
 
* Test external I2C I/O connector
 
* Test external I2C I/O connector
Line 644: Line 680:
 
</PRE>
 
</PRE>
  
=== MCP23008 Demo Code ===
+
==== MCP23008 Demo Code ====
  
 
* [[I2CIO-8]] card
 
* [[I2CIO-8]] card
Line 667: Line 703:
 
** External I2C on J1
 
** External I2C on J1
 
** (2) 1x20 headers breakout all Pico pins
 
** (2) 1x20 headers breakout all Pico pins
* Card does not have support for
+
* CircuitPython does not have built-in support for
 
** VGA
 
** VGA
 
** PS/2
 
** PS/2
Line 732: Line 768:
 
</pre>
 
</pre>
  
== Factory Test ==
+
== Factory Test Procedure ==
  
* Test cards using this procedure
+
* Test assembled cards using this procedure
* Assumes MMBASIC is already set up on the card
+
* MMBASIC is already set up on the card
  
 
=== Equipment ===
 
=== Equipment ===
Line 743: Line 779:
 
* Stereo amplified speakers
 
* Stereo amplified speakers
 
* PS/2 keyboard
 
* PS/2 keyboard
* MBASIC SD card with contents
+
* MMBASIC SD card with contents
 
** [https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs Test Software repo]
 
** [https://github.com/land-boards/RasPiPico/tree/main/PicoMite_MMBASIC/PicoMite_VGA/Land%20Boards%20BASIC%20Programs Test Software repo]
* Raspberry Pi Pico
+
* Raspberry Pi Pico with MMBASIC installed
* PC running TeraTerm
+
* PC running [http://www.teraterm.org/ TeraTerm]
 
* If optional port expander is installed
 
* If optional port expander is installed
 
** [[LED-32]] card
 
** [[LED-32]] card
Line 782: Line 818:
 
<pre>
 
<pre>
 
play stop
 
play stop
 +
</pre>
 +
 +
=== Test Keyboard ===
 +
 +
* Type on keyboard
 +
* Verify keys show up on VGA
 +
 +
=== Test VGA ===
 +
 +
* Type
 +
 +
<pre>
 +
chdir "/demos"
 +
load "Colours.bas"
 +
run
 +
 +
</pre>
 +
 +
* Verify 16 distinct colors on VGA
 +
* Type
 +
 +
<pre>
 +
mode 1
 +
 
</pre>
 
</pre>
  
Line 1,172: Line 1,232:
 
|-
 
|-
 
|}
 
|}
 +
 +
=== Test 5V in ===
 +
 +
* Connect USB B to 5V (or PC)
 +
* Remove USB Micro cable
 +
* Card should continue to run
  
 
=== Test I2C header (RTC) ===
 
=== Test I2C header (RTC) ===
Line 1,204: Line 1,270:
 
* Verify RTC time works
 
* Verify RTC time works
  
=== Test 5V in ===
+
=== Combined Copy/Paste ===
 +
 
 +
* Above tests can be copy/pasted
 +
 
 +
<pre>
 +
files
 +
 
 +
chdir "/wave"
 +
play wav "sample4.wav"
 +
 
 +
play stop
 +
 
 +
chdir "/demos"
 +
load "Colours.bas"
 +
 
 +
mode 1
  
* Connect USB B to 5V (or PC)
+
option system i2c gp0, gp1
* Remove USB Micro cable
+
rtc gettime
* Card should continue to run
+
print time$
 +
</pre>
  
 
== Mechanicals ==
 
== Mechanicals ==

Revision as of 19:31, 11 July 2022

Tindie-mediums.png

PiPicoMite-02 P18268 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 (this version)
      • Has 32-bit port I/O expander(s)
      • 95x95mm with (4) 6-32 mounting holes
    • PiPicoMite03
      • 99.5x69.5mm - Fits into extruded Aluminum Enclosure
      • Fully functional, reduced cost

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
  • Stereo audio
  • 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
  • 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, 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

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

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

DC37 F.jpg

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

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

PiPicoMite01 J1 SD Card.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 gp0, gp1

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
    • First two will reboot card
OPTION SDCARD GP13, GP10, GP11, GP12
OPTION AUDIO GP6, GP7
OPTION COLOURCODE ON
OPTION POWER PWM

  • Remove USB power
  • Install SD card
  • Apply USB power

PicoMite Source code

On-Board 32-bit Port Expanders Example Code

Example code that uses the (2) MCP23017 Port Expanders on the card

GPIO32-01.bas

  • GPIO32-01.bas
    • Test the (2) MCP23017 parts on the PiPicoMite02 card
    • Light all of the output pins one at a time
    • Alternate patterns then bounce a LED

GPIO32_Bits.bas

Land Boards Card Test Code

External MCP23017 I2C Demo Code

  • Test external I2C I/O connector
  • External PROTO16-I2C card
  • External PIO16-01.BAS - GitHub repo
  • 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

CircuitPython on PiPicoMite0x Cards

  • Reduced parts count for CircuitPython

PiPicoMite02 CPBuild P18348-720px.jpg

  • The PiPicoMite0x cards can run CircuitPython with some limitations
  • Card features for CircuitPython application
    • SD support
    • (2) MCP23017, 16-bit port expanders for 32-bits of Digital I/O
      • DB-37
    • 5V input
    • External I2C on J1
    • (2) 1x20 headers breakout all Pico pins
  • CircuitPython does not have built-in 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)

CircuitPython SD Card

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

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 5V in

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

Test I2C header (RTC)

PiPicoMite02 J1 I2C.PNG

  1. J1 I2C0SCL wired to RTC SCL
  2. J1 I2C0SDA wired to RTC SDA
  3. J1 VCC wired to RTC VCC
  4. J1 GND wired to RTC GND

RTC PartsSide.PNG

  • 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

Combined Copy/Paste

  • Above tests can be copy/pasted
files

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

play stop

chdir "/demos"
load "Colours.bas"

mode 1

option system i2c gp0, gp1
rtc gettime
print time$

Mechanicals

PicoMite02 Rev1 Mechs.PNG

Issues

Rev 1

  • No issues

Assembly Sheet