Difference between revisions of "PiPicoMite03"

From Land Boards Wiki
Jump to navigation Jump to search
Line 50: Line 50:
 
* [http://land-boards.com/PiPicoMite01/PiPicoMite03_Rev1_Schematic.pdf PiPicoMite03 Rev 1 Schematic]
 
* [http://land-boards.com/PiPicoMite01/PiPicoMite03_Rev1_Schematic.pdf PiPicoMite03 Rev 1 Schematic]
  
== Rev 2 Connectors ==
+
== Connectors ==
  
* The following are for Rev 2 and later boards
+
[[file:PicoMite03_Rev1_CAD.PNG]]
  
[[file:PicoMite01_Rev2_CAD.PNG]]
 
  
=== J1 - MCP23017 - 16-bit GPIO ===
+
=== VGA ===
 
 
* [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 132: Line 71:
 
[[file:PiPicoMite01_J2_VGA.PNG]]
 
[[file:PiPicoMite01_J2_VGA.PNG]]
  
=== J3 - 3.3V Power Out ===
+
=== Audio ===
 
 
* Power external interfaces
 
* 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]]
 
 
 
=== J4 - Audio ===
 
  
 
* Low Pass filter
 
* Low Pass filter
Line 155: Line 86:
 
[[file:PiPicoMite01_J4_Audio.PNG]]
 
[[file:PiPicoMite01_J4_Audio.PNG]]
  
=== J5 - USB B Power Connector ===
+
=== USB B Power Connector ===
  
 
* In parallel with J6
 
* In parallel with J6
Line 164: Line 95:
 
* No USB signal connections, just used for power
 
* No USB signal connections, just used for power
  
=== J6 - 5V Input ===
+
=== PS/2 Keyboard ===
 
 
[[file:PiPicoMite01_J6-5V.PNG]]
 
 
 
* Useful to power the card from external 5V
 
* 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.
 
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.
Line 179: Line 103:
 
[[file:PiPicoMite01_J7_PS2-Keyboard.PNG]]
 
[[file:PiPicoMite01_J7_PS2-Keyboard.PNG]]
  
=== J8 - I2C0, UART0 (RTC, etc.) ===
+
=== I2C0, UART0 (RTC, etc.) ===
  
 
[[FILE:PiPicoMite01_J8_I2C.PNG]]
 
[[FILE:PiPicoMite01_J8_I2C.PNG]]
Line 194: Line 118:
 
</pre>
 
</pre>
  
=== J9,J10 Pico Connectors ===
+
=== Pico GVS Connectors ===
  
* Pico pins are brought out to 1x20 pin headers J9, J10
+
* Spare Pico pins are brought out to 1x20 pin headers J9, J10
  
 
[[file:PiPicoMite01_J9-10_PiPico.PNG]]
 
[[file:PiPicoMite01_J9-10_PiPico.PNG]]
  
==== Pico Function Mapping ====
+
=== SD Card ===
 
 
{| class="wikitable"
 
! 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 352: Line 135:
  
 
[[file:PiPicoMite01_J1_SD_Card.PNG]]
 
[[file:PiPicoMite01_J1_SD_Card.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 ==

Revision as of 09:23, 18 June 2022

Tindie-mediums.png

PiPicoMite03 Front-3D.png

Features

  • Targeted to fit in extruded Aluminum box
  • Raspberry Pi Pico
    • 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
  • I2C0 connector (DS1307 RTC compatible)
  • 5V power input on USB B
  • 99.5mmx69.5mm outline

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

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

PiPicoMite03 Rear-3D.png

Schematic

Connectors

PicoMite03 Rev1 CAD.PNG


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

PiPicoMite01 J2 VGA.PNG

Audio

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

PiPicoMite01 J4 Audio.PNG

USB B Power Connector

  • In parallel with J6

PiPicoMite01 J5 5V-Power.PNG

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

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

PiPicoMite01 J7 PS2-Keyboard.PNG

I2C0, UART0 (RTC, etc.)

PiPicoMite01 J8 I2C.PNG

  1. I2C0SCL. UART0_TX (GP1)
  2. I2C0SDA. UART0_RX (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.

option system i2c gp0, gp1

Pico GVS Connectors

  • Spare Pico pins are brought out to 1x20 pin headers J9, J10

PiPicoMite01 J9-10 PiPico.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

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

Prototype Build

PicoMite Proto P18159 720px.jpg

Mechanicals

PicoMite01 Rev2 Mechs.PNG

PicoMite Software

PicoMite Source code

MCP23017 on external cards

MCP23008 Demo Code

I2CIO-8 card

MMBASIC vs MicroPython Performance

Factory Test

Equipment

  • Unit Under Test (UUT)
  • VGA monitor
  • Stereo amplified speakers
  • PS/2 keyboard
  • MBASIC SD card
  • 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 (Rev 2 card) (optional MCP23017 is installed)

  • Connect LED-32 card to J1
  • Type
chdir "/lbcards/GPIO16"
> load "MCP23017_BLINKEY.BAS"
> run
Blink a bit on the On-board MCP23017 PORTA Bit 0
Hit a key to stop
  • Single LED will blink
  • Any key will stop the program
flash save 1
  • Type
>load "gpio16-01.bas"
>run
Looping through LEDs
Hit a key to stop
  • LEDs will blink
  • Any key will stop the program
flash save 2

Test 5V in

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

Test I2C

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

Issues

Rev 1

  • Not yet ordered

Assembly Sheet