Silicon ChipVGA PicoMite - July 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Low-cost UPSes are not worth the risk
  4. Feature: IC Fabrication, Part 2 by Dr David Maddison
  5. Project: Multimeter Calibrator & Checker by Tim Blythman
  6. Review: Anycubic Photon Mono 3D printer by Tim Blythman
  7. Project: VGA PicoMite by Geoff Graham
  8. Project: 0-110dB RF Attenuator by Charles Kosina
  9. Review: Oatley Solar Charge Controller by John Clarke
  10. Project: Secure Remote Mains Switch, Part 1 by John Clarke
  11. Product Showcase
  12. Feature: PAS CO2 Air Quality Sensor by Jim Rowe
  13. Serviceman's Log: Trail camera fun by Dave Thompson
  14. Subscriptions
  15. Vintage Radio: Astor CJ-12 car radio by Dr Hugo Holden
  16. PartShop
  17. Market Centre
  18. Advertising Index
  19. Notes & Errata: MOS Air Quality Sensors, June 2022; Railway Semaphore Signal, April 2022; High Power DC Motor Speed Controller, January & February 2017
  20. Outer Back Cover

This is only a preview of the July 2022 issue of Silicon Chip.

You can view 44 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • IC Fabrication, Part 1 (June 2022)
  • IC Fabrication, Part 1 (June 2022)
  • IC Fabrication, Part 2 (July 2022)
  • IC Fabrication, Part 2 (July 2022)
  • IC Fabrication, Part 3 (August 2022)
  • IC Fabrication, Part 3 (August 2022)
Items relevant to "Multimeter Calibrator & Checker":
  • Multimeter Checker & Calibrator PCB [04107221] (AUD $5.00)
  • PIC16F1459-I/SO programmed for the Multimeter Calibrator/Checker (0410722B.HEX) (Programmed Microcontroller, AUD $10.00)
  • Complete kit for the Multimeter Checker (Component, AUD $45.00)
  • Firmware and source code for the Multimeter Checker/Calibrator [0410722A/B] (Software, Free)
  • Multimeter Checker & Calibrator PCB pattern (PDF download) [04107221] (Free)
Items relevant to "VGA PicoMite":
  • VGA PicoMite PCB [07107221] (AUD $5.00)
  • VGA PicoMite short-form kit (Component, AUD $37.50)
  • VGA PicoMite short-form kit with case (Component, AUD $55.00)
  • Firmware and user manual for the VGA PicoMite (Software, Free)
  • VGA PicoMite PCB pattern (PDF download) [07107221] (Free)
  • Cutting/drilling guides for the VGA PicoMite front & rear panels (Panel Artwork, Free)
Articles in this series:
  • The Raspberry Pi-based PicoMite (January 2022)
  • The Raspberry Pi-based PicoMite (January 2022)
  • VGA PicoMite (July 2022)
  • VGA PicoMite (July 2022)
  • The PicoMite 2 (February 2025)
  • The PicoMite 2 (February 2025)
Items relevant to "0-110dB RF Attenuator":
  • 0-110dB RF Attenuator PCB [CSE211003] (AUD $5.00)
  • ATmega328P programmed with the firmware for the 110dB RF Attenuator [CSE211003.HEX] (Programmed Microcontroller, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • 0.96in cyan OLED with SSD1306 controller (Component, AUD $10.00)
  • Short-form kit for the 0-110dB RF Attenuator (Component, AUD $75.00)
  • Firmware and BASIC source code for the 0-110dB RF Attenuator [Attenuator 3] (Software, Free)
  • 0-110dB RF Attenuator PCB pattern (PDF download) [CSE211003A] (Free)
  • Front panel label and drilling diagram for the 110dB RF Attenuator (Panel Artwork, Free)
Items relevant to "Secure Remote Mains Switch, Part 1":
  • Secure Remote Mains Switch receiver PCB [10109211] (AUD $7.50)
  • Secure Remote Mains Switch transmitter PCB [10109212] (AUD $2.50)
  • PIC16F1459-I/P programmed for the Secure Remote Mains Switch receiver (1010921R.HEX) (Programmed Microcontroller, AUD $10.00)
  • PIC16LF15323-I/SL programmed for the Secure Remote Mains Switch transmitter (1010921A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware and ASM source code for the Secure Remote Mains Switch [1010921A/R] (Software, Free)
  • Secure Remote Mains Switch PCB patterns (PDF download) [10109211/2] (Free)
  • Front panel label and drilling diagrams for the Secure Remote Mains Switch (Panel Artwork, Free)
Articles in this series:
  • Secure Remote Mains Switch, Part 1 (July 2022)
  • Secure Remote Mains Switch, Part 1 (July 2022)
  • Secure Remote Mains Switch, Part 2 (August 2022)
  • Secure Remote Mains Switch, Part 2 (August 2022)
  • Secure Remote Switch, Part 1 (December 2024)
  • Secure Remote Switch, Part 1 (December 2024)
  • Secure Remote Mains Switch, part two (January 2025)
  • Secure Remote Mains Switch, part two (January 2025)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)

Purchase a printed copy of this issue for $11.50.

e t i M o c i P A VG to a powerful, bu t simple ‘boot BASIC’ computer With the low-cost Raspberry Pi Pico board, a handful of standard components and our new firmware, you can build this amazingly capable ‘boot to BASIC’ computer. It has a 16-colour VGA output, a PS/2 keyboard input, runs programs from an SD card and can be built in no time. And it uses our popular fullyfeatured MMBasic interpreter. A fter the fun of building it, you can have even more fun writing programs to track your expenses, teach children about computing, play simple computer games and calculate the positions of the planets (to name a few possible activities). ‘Boot to BASIC’ computers were popular in the early 1980s – think of the Tandy TRS-80, Vic 20, Commodore 64 and 128, Apple II, Amigas and many others. After turning them on, within a fraction of a second, you have access to the built-in BASIC language, where you can test commands, then enter or load a program and run it. The operating system is built-in. Developing a program is fast and stress-free. You use the editor to enter the program into memory and run it with one keystroke. If there is an error in your program, you get a plain English message pointing to the problem. With another keystroke, you will be taken back into the editor with the cursor placed on the line that caused the error, ready to be fixed. If this sounds familiar, that’s because this computer is the latest of a series that we have published over the years, starting with the monochrome Maximite (March-May 2011; siliconchip. com.au/Series/30) and including the Colour Maximite 2 (July & August 2020; siliconchip.com.au/Series/348 and August & September 2021; siliconchip.com.au/Series/368). What sets this one apart is that it is so simple. The Raspberry Pi Pico module costs less than $10, and with just a few other components, you have a fully working computer. While it is simple, it does not lack performance. It runs a dual-core 32-bit CPU with a clock speed of up to 252MHz, has 103KB of program memory, a 640 x 480 pixel VGA output and stores programs and data on standard Words and MMBasic by Geoff Graham 52 Silicon Chip SD cards. To put that into perspective, it is about 100 times faster and more capable than the Apple II computer that was so popular in its heyday, yet costs about 1/100th as much! This firmware is derived from the PicoMite firmware for the Raspberry Pi Pico that we described in the January 2022 issue (siliconchip.com.au/ Article/15177). In this version, we have removed the ability to drive LCD panels and replaced it with the ability to produce a colour VGA signal. Other than this, the two versions are identical. VGA output The VGA output is generated within the Raspberry Pi Pico, a considerable feat for a low-cost processor without any specialised hardware for the task. It is derived from work by Miroslav Nemecek in the Czech Republic, ported by Peter Mather in the UK. VGA PicoMite firmware by Peter Mather Australia's electronics magazine siliconchip.com.au The Raspberry Pi Pico (shown 50% larger than real life) is a popular and cheap microcontroller module with plenty of memory, speed and I/O capability. With our VGA PicoMite firmware, you can easily program it in BASIC with a VGA monitor, keyboard and SD card storage support and access to all the Pico’s features. The VGA signal is generated using the second CPU in the RP2040 processor on the Raspberry Pi Pico plus one PIO channel. Because of this, it does not affect the performance of the BASIC interpreter, which runs unimpeded at full speed on the first CPU. The video signal is in the standard VGA format with a pixel rate of 25.175MHz and a frame rate of 60Hz, so you get a stable video output that is supported by all VGA monitors. In monochrome mode, the resolution is 640 x 480 pixels, while in colour mode, the pixels are doubled horizontally and vertically to give an effective resolution of 320 x 240 pixels. Regardless of the mode, the monitor still receives a 640 x 480 pixel image, and virtually all monitors support this mode. The colour mode uses four bits to define the colour of each pixel, giving a total of sixteen (24) colours (including black). One bit is assigned to red, two bits for green and one bit for blue. While this is not very good for displaying photographs, it is great for games, graphs and brightening up the output of your programs. The graphics driver includes some of the features of the Colour Maximite 2. So, in addition to drawing lines, boxes, etc, you can also have multiple fonts and create fast animations with the BLIT command. You can load images from the SD card for display on the video screen, and you can save an image of the current screen to the SD card (ie, take a screenshot/screengrab). The hardware to generate the VGA signal only uses eight resistors and two diodes to generate the correct signal levels. These components can be assembled on a piece of perforated stripboard (eg, Veroboard), but we felt that many people would like the convenience of building it on a PCB, so we have designed a simple board that includes the VGA output and the keyboard and SD card interfaces. siliconchip.com.au But, if you want to build it on an extreme budget, the stripboard solution will work fine. Keyboard and SD card The VGA PicoMite firmware supports standard PS/2 keyboards. While they are less popular today than USB keyboards, there are still plenty to be found, and many wired USB keyboards come with a PS/2 adaptor. These work perfectly with the VGA PicoMite. The keyboard is fully supported; auto-repeat and the arrow and function keys work as expected. The PS/2 standard uses 5V signal levels, but the Raspberry Pi Pico is strictly limited to a maximum of 3.6V, so level shifting is required to interface the Pico with the keyboard. This is done using four resistors and two Mosfets. Like the VGA interface, this could be built on a perforated stripboard if you do not want to use our PCB (although it isn’t exactly expensive). SD cards use 3.3V signal levels, so they can connect directly to the Raspberry Pi Pico with no interface components required. The firmware supports cards up to 32GB, formatted with a FAT16 or FAT32 file system. MMBasic supports long file names, hierarchical folders etc. You can save, load and run BASIC programs from the card as well as read/write data files to it. The file system is compatible with Windows, Linux and macOS, so it is easy to use an SD card to transfer data back and forth between the VGA PicoMite and a computer or laptop. However, an SD card is not necessary as the firmware reserves eight ‘slots’ for BASIC programs in the Pico’s flash memory. So you can save or retrieve up to eight separate programs there if you wish. If you are just casually playing with this computer, that could be all you need. Regardless, adding SD card support is so easy that we have included it on our PCB. Australia's electronics magazine The firmware supports many other devices that can be connected, including infrared (IR) remote control receivers, stereo audio output, distance sensors, a real-time clock, temperature sensors and so on. We did not clutter up the PCB with these, but you can easily connect external circuitry to the 40-pin header on the rear of the board. These pins mimic the I/O pins on the Raspberry Pi Pico (including the VGA and keyboard connections), so you can add almost whatever you want via that connector. MMBasic None of this can work without the firmware and MMBasic. We have described MMBasic many times before, so it is sufficient to say that it is a full-featured version of the BASIC computer language designed to be easy to use. As mentioned before, the firmware includes a built-in editor with a colour-coded display plus support for all the peripherals described above (and more). On the VGA PicoMite, programs can be as large as 108KB. The amount of RAM available for buffers, arrays, etc is even larger at 140KB, so you can have very large data arrays. By default, the CPU runs with an instruction clock of 126MHz, but you can switch it to 252MHz. This is ‘overclocking’ the RP2040 processor used in the Raspberry Pi Pico, which has a specified top speed of 133MHz. However, nearly all the Picos we have tested run fine at this speed, so it is a viable option if you want to go mad with the performance. One feature that will be appreciated by people who played with the early computers of the 1980s is that MMBasic saves the program to flash memory, not RAM. When you edit a program, it is saved to flash, and when you run it, it runs from flash. Because flash memory is non-volatile, July 2022  53 you will not lose your program, even if you accidentally restart the device or interrupt the power – something that happened distressingly often with the early computers that stored programs in volatile RAM. Circuit details Fig.1 is the straightforward circuit of the VGA PicoMite. The VGA output from the Raspberry Pi Pico uses six digital signals – one for red, two for green, one for blue and one each for horizontal and vertical synchronisation. For the red and blue signals, the digital output levels are simply clipped by the 1N4148 diodes to 0.7V, the correct level for full brightness in the VGA standard. The green output also has a resistor network providing four intensity levels from completely off to full brightness. The 200W multi-turn trimming potentiometer lets you adjust for a balanced white output without needing precision resistors with hard-tofind values. The horizontal and vertical sync signals use standard TTL signal levels, so they directly connect to the monitor. The keyboard interface consists of just two signals, the clock and the data lines, which are bi-directional. Each signal is level-shifted using two resistors and a small 2N7000 Mosfet. There are many ways to implement level shifting, but this is cheap and uses common components. In the idle state, the outputs from the Pico and the keyboard are pulled high to 3.3V and 5V respectively, by 10kW pull-up resistors. When the Pico wants to send a signal, it pulls its output low, causing the Mosfet to conduct because its gate is held at +3.3V. This means that the keyboard’s corresponding pin is also pulled low. When the keyboard wants to signal, it pulls its pin low, and that causes the substrate diode in the Mosfet to conduct and also pull the Pico’s corresponding pin low. There is very little to the SD card interface. All the SD card signal lines connect directly to the Raspberry Pi Pico as both the SD card and the Pico use 3.3V logic signalling. This SPI serial bus consists of four signals: • Chip select (CS), which is pulled low by the Pico when it wants to communicate. • The clock, generated by the Pico. • Master out slave in (MOSI), which carries data from the Pico (the master) to the card. • Master in slave out (MISO), which carries data from the card to the Pico. The card socket also has switches to indicate when a card is inserted and whether it is write-protected, but these are not used to keep the maximum number of the Pico’s I/O pins free. Instead, the card’s insertion and removal are detected by ‘polling’ the SD card (ie, periodically checking if it is present). The Raspberry Pi Pico itself is powered via its micro USB connector, which provides 5V for the PS/2 Fig.1: the VGA PicoMite circuit mainly comprises the components necessary to convert the Raspberry Pi Pico’s signal levels to that required by the PS/2 keyboard and VGA monitor. It could be assembled on a piece of perforated stripboard, but the commercial PCB doesn’t cost that much, makes construction much easier and gives a more professional-looking result. 54 Silicon Chip Australia's electronics magazine siliconchip.com.au keyboard. The output of the Pico’s onboard 3.3V regulator is used to power the processor and flash memory, and is also fed to the SD card. For maximum flexibility, all 40 pins on the Raspberry Pi Pico are routed to the 40-way connector on the rear of the PCB in the same configuration as that used by the Pico. This makes it easy to connect external devices using jumper wires, as you can consult the Pico pinout diagram and then select the corresponding pins on the 40-way connector. Taking into consideration the I/O pins reserved for the VGA output, keyboard and SD card, there are still 14 I/Os available for interacting with external circuitry. Construction The simplest way to source the components is to purchase a kit from the Silicon Chip Online Shop, which includes everything except a power supply and a case. But if you decide to source the parts yourself, you might have some difficulties due to current shortages, especially with the VGA and SD card connectors. It can help to use a parts search site like https://octopart.com to identify suppliers that currently have stock of a given part. Populating the PCB is straightforward (see Fig.2). As usual, start with the low-profile components and work upward. Preferably, your soldering iron should be temperature-controlled and have a chisel or conical tip with a diameter of 1.7mm or thereabouts. You can get away with other sizes, but some of the pads (for example, on the VGA connector) are close together, meaning a smaller tip will be easier to use. Note the choice of mounting a vertical or right-angle 2x20-pin header for CON4 depending on whether you’re using a case or not. The SD card socket is surface-­ mounted and, because you need space to get your soldering iron close to it, you should start with that. Begin by applying a thin layer of flux paste on all its pads. It has two small posts on the underside that click into matching holes in the PCB to ensure perfect alignment. With the socket in position, solder the two tabs on the right side of the socket (viewed from the front) and the five on the left side. Now that the siliconchip.com.au Parts List – VGA PicoMite 1 double-sided PCB coded 07107221, 124mm x 69mm 1 Raspberry Pi Pico 1 right-angle PCB-mount DE15 (VGA) socket (CON1) [TE Connectivity 1-1734530-1 or Multicomp SPC15430; Mouser, element14, RS] 1 right-angle PCB-mount 6-pin mini-DIN socket (CON2) [Altronics P1106 or element14 1200113] 1 Hirose DM1AA-SF-PEJ(72) or DM1AA-SF-PEJ(82) SD card connector (CON3) [Mouser, Digi-Key, element14, RS] 1 2×20-pin header, 2.54mm pitch (CON4) OR 1 2×20-pin right-angle box header, 2.54mm pitch (CON4) (for installation in a case) 1 4-pin vertical short actuator tactile switch (S1) [Altronics S1120 or element14 4511189] 1 200W multi-turn top-adjust trimpot (VR1) [Altronics R2372A or element14 9353569] 2 2N7000 60V 200mA N-channel Mosfets, TO-92 (Q1, Q2) 2 IN4148 diodes (D1, D2) 1 100nF 50V+ multi-layer ceramic or MKT capacitor Resistors (all through-hole 1/4W 5%) 4 10kW metal or carbon film resistors 7 220W metal or carbon film resistors Optional parts 1 71 × 130 × 30mm grey ABS instrument case [Altronics H0376] 4 No.2 × 4-5mm self-tapping screws (if mounting PCB in case) 4 stick-on rubber feet or short tapped spacers with M3 machine screws (if using PCB without case) 2 20-pin SIL headers, 2.54mm pitch (to make Pico module pluggable) 2 20-pin SIL header sockets, 2.54mm pitch (to make Pico module pluggable) Kit: a mostly complete kit for the VGA PicoMite is available from the Silicon Chip Online Shop (Cat SC6417 SC6417) for $35. It includes the PCB and everything that mounts on it. You just need to add a USB power supply, keyboard, monitor and optionally an SD card. This can be mounted in a case although you’ll also need a different header for CON4 and some self-tapping screws. Fig.2: assembling the VGA PicoMite is easy; just fit the parts as shown here, starting with the lower-profile components and working up to the taller ones. The diodes, Mosfets & Pico must be orientated correctly. The main options to consider are whether you’re using headers for the Pico and the type of connector you’re using for CON4. Australia's electronics magazine July 2022  55 The Raspberry Pi Pico can be directly soldered to the PCB, or you can solder pin headers to the Pico and then plug this assembly into matching SIL header sockets soldered to the PCB, as shown in the adjacent photo. Using the sockets is the safest option as you can then easily replace the Pico if you suspect that it has been damaged. Housing the VGA PicoMite If you want to house the VGA PicoMite in a box, the board is sized to fit in the Altronics H0376 snap-together case. The Raspberry Pi Pico can be directly soldered to the PCB, or you can solder pin headers to the Pico and then plug this assembly into two matching 20-pin single-in-line (SIL) header sockets installed on the PCB. Using headers means that you can easily replace the Pico if it fails. socket is secured, you can solder the nine pins on the rear. For each pin, slide the tip of your iron over the solder pad towards the connector so that the tip hits the connector’s pin. Within half a second, the solder should magically flow around the pin, and you can withdraw the iron. If you get a solder bridge, don’t worry and carry on with the other pins. Finally, examine your soldering using a powerful magnifier and check for any bridges (especially to the connector’s shield) and remove them using more flux paste and solder wick. Be careful here, as the solder wick can suck up all the solder, so you should recheck the joint after using it (although it usually leaves a sufficient amount behind). We expect that most readers will put rubber feet on the bottom of the PCB and use it as is (‘naked’). Another option for feet is tapped spacers via the mounting holes. Still, if you want to house it in a box, the board is sized to fit in a small 71 x 130 x 30mm instrument case (Altronics H0376). Incidentally, this is the same case that was used for the first ‘boot to BASIC’ computer we published, the original Maximite, back in 2011. If you are planning to house the PCB in this, you can replace the vertical 40-way pin header on the rear of the PCB with a right angle shrouded IDC connector so that you can use a ribbon cable to connect to any external circuits. See Fig.3 for the front and rear panel‘s drilling diagram to suit the Altronics H0376 case. Loading the firmware Loading the firmware onto the Raspberry Pi Pico is quick and easy, thanks to the bootloader built into the Pico. All you need to do is hold down the white button on the top of the Pico while plugging its USB connector into your computer. The Raspberry Fig.3: use these front & rear panel cutting diagrams/ templates to locate and size the holes in the case. The central cut-out in the front is to plug a cable into the USB socket on the Pico. Use the upper, dashed cut-out if you’ve mounted the Pico on headers. Either way, it might need enlarging depending on the size of the plug on your USB cable. The distance between the dashed cutout on the front panel and the cutout below it is 5mm. 56 Silicon Chip Australia's electronics magazine siliconchip.com.au Pi Pico will appear as a pseudo USB flash drive onto which you copy (eg, drag and drop) the “PicoMiteVGA.uf2” firmware file. This will upload the file to the Pico and program it into its flash memory. Following this, the Raspberry Pi Pico will drop the USB connection and reconnect as a virtual serial port over USB. But you can ignore that for the moment, as it will also come up driving the VGA output and looking for an attached keyboard. If you have a VGA monitor attached, you will see the MMBasic copyright message (as shown in Screen 1) and, if you have a keyboard attached, you can try typing in a command. For example, try “PRINT 2 + 2” and, unless your computer failed kindergarten, it will display the number 4. The only adjustment needed is the 200W trimpot for the white balance. To correctly set this, you should display a large area of white. You can do this by entering the following line at the command prompt: CLS RGB(white) This will clear the screen to a white background, and you can then adjust the trimpot for a neutral white colour without a tint. Fault finding If you do not see anything on your monitor after loading the firmware, start by checking the green LED on the top of the Raspberry Pi Pico. It should be slowly flashing off/on with a period of about a second and a half. This indicates that the Pico is correctly programmed with the firmware and is running MMBasic. If you do not see the LED flashing, reprogram the Raspberry Pi Pico and make sure that it completes successfully. Also make sure that you used the VGA PicoMite firmware and not the standard PicoMite firmware without the VGA capability – that will also flash the LED but not provide the VGA output. If the Raspberry Pi Pico is OK, you will then need to resort to standard fault-finding procedures. Carefully check all solder joints with a magnifier, look for solder bridges, check all components and their values and make sure that the orientations of the diodes and Mosfets are correct. It is also worth checking your monitor, keyboard and connecting cables. siliconchip.com.au PicoMiteVGA MMBasic Version 5.0.7.04b8 Copyright 2011-2021 Geoff Graham Copyright 2016-2021 Peter Mather > Screen 1: after loading the firmware, the VGA PicoMite will restart, activate the VGA output and look for an attached keyboard. With a VGA monitor connected, you will see this copyright message, and if you have a keyboard attached, you can try typing in a command or two. Do they work with other devices? The cables can be a problem; in the past, some constructors have been baffled by the lack of video only to discover that their VGA cable was faulty. SD card The VGA output and keyboard interfaces automatically operate after the firmware is installed, but the interface to the SD card needs to be configured before it can be used. This is done with the following command, entered on one line at the MMBasic command prompt: OPTION SDCARD GP13, GP10, GP11, GP12 This tells the firmware that the SD card socket is connected and what I/O pins are used for chip select (CS), clock, MOSI and MISO respectively. Entering this option will cause the VGA PicoMite to reboot, but from then on, the setting will be remembered, even after power off. So you only have to enter it once. After setting it up and inserting an SD card, you can test it by entering the command “FILES” at the prompt, and it should list the files and directories found on the card. If you had a BASIC program on the SD card, you could load it with the command: LOAD "filename" Then, if you edit it within MMBasic, you can save it back to the SD card with the command: SAVE "filename" The double quotes around the filename are required – you will get an error if they are not used. As mentioned earlier, the SD card is not strictly necessary. The firmware reserves eight ‘slots’ in the Raspberry Pi Pico’s flash memory for program storage on the chip. So, if you have entered a program, you could save it into (for example) slot 6 with the command “FLASH Australia's electronics magazine SAVE 6”. Later, you can load it back into program memory with the “FLASH LOAD 6” command. What next? To get a feel for the VGA Pico­Mite, you can enter the following short program. Start the process with the “EDIT” command. This is described in the user manual but, for the moment, all that you need to know is that in the editor, anything that you type will be inserted at the cursor, the arrow keys will move the cursor and backspace will delete the character before the cursor. At the command prompt, type EDIT followed by the Enter key. The editor should start up, and you can type the following four lines: DO INPUT "What is your name? ", N$ PRINT "Hello, " N$ LOOP Then press the F1 key on the keyboard. This tells the editor to save your program and exit to the command prompt. At the command prompt, type RUN and press the Enter key. Your new computer should ask for your name, and when you type it in (followed by the Enter key), it will reply with a greeting. To break out of the program and return to the prompt, press Ctrl-C. There you are; you have just written and run your first program on the VGA PicoMite. If you type EDIT again, you will be taken back into the editor, where you can change or add to your program. You will probably have many questions at this point, and we have written a detailed user’s manual to answer them. You can download this for free from the Silicon Chip website or the author’s web page (https://geoffg.net/ picomitevga.html). It should cover everything that you need to know. July 2022  57 If you are new to BASIC programming, open up this manual and check out Appendix G (Programming in BASIC – A Tutorial) near the end. This comprehensive tutorial on the language will take you through the fundamentals of programming in BASIC in an easy-to-read format with lots of examples. When you have finished, you will be a ‘gung-ho’ BASIC programmer! Tetris To test out this new computer, we decided to write a program to play the game of Tetris. Tetris is well-known and has been ported to over 65 platforms, a Guinness world record. We were hoping to make it 66, but it turns out that the name and the game are copyrighted, so we developed something similar that we called Blocks, which we believe is just as much fun to play – see Screen 2. It is not a huge program (about 475 lines), and it uses just the basic graphics commands (line, box etc), so there is nothing special here. Anyone could program this game with a bit of familiarity with BASIC, and you can easily dig into the code to see how it works. On the VGA PicoMite, Blocks runs very fast, and it uses only 15% of the available program memory. This illustrates the capability of this little computer and underlines the fact that you can aim big with it, and it will not let you down. The Blocks program is included in the VGA PicoMite firmware download so all you need to do is copy it to an SD card, then transfer that card to the VGA PicoMite and enter the command: RUN "Blocks.bas" Screen 2: Blocks is a BASIC game that runs on the VGA PicoMite. It is colourful and fast, and it uses only 15% of the available program memory, so you can have fun adding to it if you wish. It will also run on the Colour Maximite 2. Screen 3: The output of the “Colours.bas” program, included with the VGA PicoMite firmware download. It shows all the colours the VGA PicoMite can generate. Run it on your computer to see the true colours as the printing press cannot reproduce all the colours accurately. 58 Silicon Chip Australia's electronics magazine Incidentally, Blocks will also run on the Colour Maximite 2, so if you have built that computer, you can try playing it on that. There are two additional programs in the firmware download package. The first is “Fonts.bas”, which will display the various fonts that come built into MMBasic on your monitor. This is handy when you are writing a program and need to select a suitable font. The second program is called “Colours.bas” and it displays all 16 colours that the VGA PicoMite can generate on the monitor, including the codes to use in your BASIC program. Screen 3 shows what its output looks like, but the printing press will not accurately reproduce the colours, so run it on your VGA PicoMite to see the true set of colours. So there you have it, one of the simplest ‘boot to BASIC’ computers possible. To keep up with firmware updates, including early ‘beta’ releases, check out the author’s website at https:// geoffg.net/picomitevga.html It’s also a good idea to visit the Back Shed forum (see www.thebackshed. com/forum/Microcontrollers) where there are many MMBasic fans swapping ideas and offering help to newcomers. SC siliconchip.com.au