Silicon ChipPico Gamer - April 2024 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Asking questions
  4. Feature: Becoming a Radio Amateur by Dr David Maddison, VK3DSM
  5. Project: Pico Gamer by Geoff Graham
  6. Project: Pico Digital Video Terminal, Pt2 by Tim Blythman
  7. Review: ROCK Model 4C+ SBC review by Tim Blythman
  8. Project: Skill Tester 9000, Pt1 by Phil Prosser
  9. Project: ESP32-CAM BackPack by Tim Blythman
  10. Product Showcase
  11. Project: Reference MEMS Microphones by Phil Prosser
  12. Serviceman's Log: Power tool batteries, part two: electric boogaloo by Dave Thompson
  13. Vintage Radio: Fender Bassman Guitar Amp by Brandon Speedie
  14. PartShop
  15. Subscriptions
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Microphone Preamplifier, February 2024; Arduino DCC Controller, January 2020
  19. Outer Back Cover

This is only a preview of the April 2024 issue of Silicon Chip.

You can view 39 of the 104 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.

Items relevant to "Becoming a Radio Amateur":
  • Ham radio links (Software, Free)
Items relevant to "Pico Gamer":
  • Pico Gamer PCB [08104241] (AUD $10.00)
  • 3.2-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $30.00)
  • Pico Gamer kit without case or battery (Component, AUD $85.00)
  • Pico Gamer kit with white case, no battery (Component, AUD $125.00)
  • Firmware for the Pico Gamer (Software, Free)
  • Pico Gamer PCB pattern (PDF download) [08104241] (Free)
Articles in this series:
  • Pico Digital Video Terminal (March 2024)
  • ETI BUNDLE (March 2024)
  • Pico Digital Video Terminal (March 2024)
  • ETI BUNDLE (March 2024)
  • Pico Digital Video Terminal, Pt2 (April 2024)
  • Pico Digital Video Terminal, Pt2 (April 2024)
Items relevant to "Skill Tester 9000, Pt1":
  • Skill Tester 9000 PCB [08101241] (AUD $15.00)
  • Skill Tester 9000 PCB pattern (PDF download) [08101241] (Free)
Articles in this series:
  • Skill Tester 9000, Pt1 (April 2024)
  • Skill Tester 9000, Pt1 (April 2024)
  • Skill Tester 9000, Part 2 (May 2024)
  • Skill Tester 9000, Part 2 (May 2024)
  • The Skill Tester 9000, part one (May 2025)
  • The Skill Tester 9000, part one (May 2025)
  • Skill Tester 9000, Part 2 (June 2025)
  • Skill Tester 9000, Part 2 (June 2025)
Items relevant to "ESP32-CAM BackPack":
  • ESP32-CAM BackPack PCB [07102241] (AUD $5.00)
  • 3.5-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $35.00)
  • CP2102-based USB/TTL serial converter with microUSB socket and 6-pin right-angle header (Component, AUD $5.00)
  • ESP32-CAM LCD BackPack short-form kit (Component, AUD $42.50)
  • Firmware for the ESP32-CAM BackPack (Software, Free)
  • ESP32-CAM BackPack PCB pattern (PDF download) [07102241] (Free)
Items relevant to "Reference MEMS Microphones":
  • Calibrated Measurement Microphone PCB (SMD version) [01108231] (AUD $2.50)
  • Calibrated Measurement Microphone PCB (TH version) [01108232] (AUD $2.50)
  • Short-form kit for the Calibrated Microphone (SMD version) (Component, AUD $22.50)
  • Short-form kit for the Calibrated Microphone (TH version) (Component, AUD $25.00)
  • Simulation and calculation files for the Calibrated Measurement Microphone (Software, Free)
  • Calibrated Measurement Microphone PCB patterns (PDF download) [01108231/2] (Free)
Articles in this series:
  • Calibrated Measurement Mic (August 2023)
  • Calibrated Measurement Mic (August 2023)
  • Reference MEMS Microphones (April 2024)
  • Reference MEMS Microphones (April 2024)

Purchase a printed copy of this issue for $12.50.

Project by Geoff Graham The Pico Gamer The Pico Gamer is a PicoMite powered ‘retro’ game console packed with nine games including three inspired by Pac-Man, Space Invaders and Tetris. With its inbuilt rechargeable battery and colour 3.2-inch (81mm) diagonal LCD screen, it will keep you entertained for many hours. T he Pico Gamer was inspired by the Game Boy series from Nintendo, introduced in 1989. They were small handheld battery-powered devices, initially with tiny monochrome screens and an eight-bit CPU. Over time, more feature-rich versions were introduced, and the series became a massive success, with over 100 million sold across all variants. The Pico Gamer is a marked upgrade on the original Game Boy, with a colour LCD screen, a dual-core 252MHz 32-bit processor, 2.5MB of internal game storage and a USB interface. It is easy to build, using just a handful of components, and fits nicely into a custom 3D-printed case. We based our design on the layout of the Game Boy Advance, with the control buttons on either side of the screen in a horizontal layout. Such a design is a natural fit for a handheld game console and has since been adopted by many other consoles. There are eight buttons on the console: four direction buttons (up, down, left & right) on the left, two control 36 Silicon Chip buttons (start and select) under the screen and two auxiliary buttons (A and B) on the right. An important feature is the built-in rechargeable lithium-ion battery; the original Game Boy used four AA cells. The Pico Gamer’s battery can last over eight hours, which is plenty for a long road trip, and can be recharged in under four hours using the built-in USB connector. It could even be recharged from a portable USB power pack in a pinch. The 3.2-inch LCD screen has a 66×50mm active area containing 320×240 pixels. It can display over 65,000 colours, which most games use to good effect. The screen is also touch-sensitive, although currently, no games use that feature. New games can be programmed in BASIC, so perhaps one of our readers will come up with one that does! The Pico Gamer has a mono audio amplifier and speaker for sound effects. Most games use them to create various beeps, squeaks and explosions. However, it is good enough to Australia's electronics magazine reproduce more complex sound effects and music, and some games do both. To see a gameplay video, visit: siliconchip.au/Videos/PicoGamer The processor The Pico Gamer is powered by the Waveshare RP2040-Plus. This is a pinfor-pin compatible clone of the Raspberry Pi Pico, with a few important upgrades. Firstly, it includes a lithium-ion battery charger, so that’s one less feature that needs to be designed into the circuit. It also uses a high-speed flash memory chip, so the RP2040 processor can be reliably overclocked to 252MHz, which is required for the more processor-intensive games. Finally, the RP2040-Plus has a 4MB flash memory chip rather than the 2MB of the standard Pico. This is important because we store the games in this flash memory, and the standard Pico has space for a limited number of games. However, the RP2040-Plus with 4MB can fit dozens of games, and you will be unlikely ever to fill that up. siliconchip.com.au Pico Gamer Kits (SC6911–3, from $85, two different cases available): see page 96 for more details Features & Specifications Games included in the Pico Gamer firmware » Dimensions: 198 × 90 × 22mm » Weight: 300g » Battery: internal 1100mAh LiPo battery » Runtime: approximately eight hours » External power/charging: 5V via USB at 260mA » Display: 66 × 50mm LCD, 320 × 240 pixels, 65,535 colours » Audio: 340mW from a 28mm diameter speaker » Internal storage: 14.5MB★ (sufficient for hundreds of games) » External storage: SD card up to 32GB, formatted as FAT16 or FAT32 » Sound test and demonstration » Button test » File Browser » A selection of pre-installed games (see the panel opposite) ★ or 2.5MB if 4MB RP2040-Plus is used, sufficient for 30+ games Using a standard Raspberry Pi Pico in the Pico Gamer would be possible. While it would work, you would have to keep it tethered via a USB cable for power. Also, you will need to install a custom version of the software because the software we supply is optimised for the 4MB (or 16MB) of flash on the Waveshare module. PETSCII Robots Lazer Cycle 3D Maze Pico Blocks Kingdom Snake Pico Man Pico Vaders Circle One In this complex strategy and exploration game, your goal is to enter the settlement and destroy the robots. The trick is finding the right tools and learning how to use them. Similar to the ever-popular Tetris game, your job is to rotate and position colourful blocks falling from the sky into a neat carpet, where they will vanish. If your pile gets too high, you will lose. You are on a fast Lazer Cycle, and so is your opponent. They will try to make you crash into a wall or track, and you try to do the same to them. It is a race to the death. You are the ruler of the Yellow River kingdom and must allocate resources between feeding the hungry people & defending against thieves. Don’t get it wrong, because the people might revolt. You are stuck in a 3D maze; your job is to explore and find a way out. You can call up a map to help, but it is not as easy as it looks. Guide your snake around the board, eating the good food and avoiding the bad. As you eat, your snake will get longer. You will need all your skills to avoid crashing into a wall! PicoMite software The software loaded onto the RP2040-Plus includes the PicoMite firmware we introduced in January 2022 (siliconchip.au/Article/15177). This is a powerful BASIC (MMBasic) interpreter for the Raspberry Pi Pico, with support for peripherals such as an LCD screen, SD card, sound etc. Because the BASIC language is built into the PicoMite, all games are written in BASIC. The latest versions of the PicoMite firmware provide an A: drive, which acts like an SD card that cannot be removed. This allows us to store programs, music files, images etc internally, without the need for external storage like an SD card. If you wish, you can plug an SD card (or microSD card in an SD card adaptor) into the socket on the LCD screen, and it will be available as “drive B:”. The menu system will allow you to siliconchip.com.au Inspired by the addictive Pac-Man game, you race around a maze, eating little dots while being chased by four ghosts. Eating a Power Ball gives you special powers, so you can pursue the ghosts instead! Based on the classic Space Invaders from the 1980s, you are faced with hordes of invaders who drop a steady stream of bombs while you dodge back and forth with your cannon, trying to shoot them down. switch to this drive and run games from it. However, this is not a requirement, and usually, the internal file system (drive A:) is sufficient to store all the games. The PicoMite also implements flash slots as alternative storage places for programs. There are three of them, and when a program is run from one of these, it does not need to be loaded Australia's electronics magazine This game’s objective is to eat the apples and grow while your opposition (the computer) will try to do the same. The one who grows to the maximum size wins. It is a simple but entertaining game that is perfect for young children. into the main program memory, so it executes quickly. The Pico Gamer’s menu program is stored in the first flash slot, so it is always ready to run. Acknowledgments The Pico Gamer is based on the work of many people from around the world. The concept of a Game Boy lookalike using the Raspberry Pi Pico April 2024  37 Fig.1: the Pico Gamer has three main components: the RP2040-Plus microcontroller module, 3.2-inch touchscreen and audio amplifier/speaker. The RP2040Plus module incorporates a battery charger, so we can just connect the LiPo battery directly to it. was pioneered by Tom Williams in the UK, and he designed the Game*Mite with some help from Australian Mick Gulovsen. He published his design on The Back Shed Forum (siliconchip.au/ link/absd) and it has been quite successful, with several hardware clones and many extra games added to its repertoire. The games themselves came from authors including Martin Herhaus (Germany), Harm (Netherlands), Tom Williams (UK) and Geoff Graham (Australia). Tom Williams also wrote most of the utility programs. You can contact these authors on The Back Shed Forum with suggestions and bug reports if you need to. We have kept the hardware features of the Pico Gamer compatible with the Game*Mite, so games and programs written for one will run on the other. If you wish, you can even load Tom’s full firmware package for his Game*Mite onto the Pico Gamer, and it will run equally well. Circuit details As you would expect, the circuit (Fig.1) is dominated by the 38 Silicon Chip RP2040-Plus module. The eight game buttons connect directly to the processor, pulling the associated input pin low when pressed. Programs running on the Pico Gamer configure these pins as inputs with internal pullup resistors, so external resistors are not required. The power switch in the off position disconnects the battery and disables the power supply in the RP2040Plus. The latter is done so that the Pico Gamer will shut down even if it is connected to a USB power supply. The battery charger in the RP2040Plus will terminate at 4.2V, the correct voltage for standard LiPo batteries, so it will not overcharge them. When the Pico Gamer runs on battery power, the protection circuit within the battery will automatically disconnect the load so you cannot damage the battery by accidentally leaving the console on. The LCD screen is connected to the processor via an SPI bus, which drives the display, touch controller and SD card socket. The LCD and the audio amplifier are both powered by the RP2040-Plus via its 3.3V output. This is used because the Pico’s onboard DC-to-DC converter ensures Australia's electronics magazine a constant output voltage regardless of the battery voltage, which can vary from 4.2V to about 2V. The sound output is generated as stereo pulse width modulated (PWM) signals from digital output pins GP20 and GP21. These signals are filtered and summed by the two 330W resistors and the 100nF capacitor. The resultant mono audio is fed to an SSM2211SZ audio amplifier, which drives the speaker in a bridged configuration. With a 3.3V power supply, the SSM2211SZ does not generate much power, but the volume is ample for a handheld device. Sourcing the parts We are offering kits that include all parts except the battery (which can’t be sent by airmail). There is the option of no case (if you want to print your own), a basic case that you can paint any colour and a more expensive black case that shouldn’t need to be painted. So that’s one way to get the parts to build the Pico Gamer. You can get a suitable 1100mAh 3.7V LiPo battery from your local Altronics store (Cat S4724) or a local seller on eBay. siliconchip.com.au The front of the PCB has the 3.2-inch LCD screen, buttons, switches, audio amp IC & passive components. The rear of the PCB holds the RP2040-Plus, battery, volume potentiometer & speaker. It is necessary to solder the RP2040-Plus flush with the PCB so that the USB connector aligns with the cutout in the case. If you want to gather the rest of the parts yourself, here are suggestions: The core of the Pico Gamer is the Waveshare RP2040-Plus, available from Waveshare (www.waveshare. com), Amazon and Australian distributors such as Little Bird Electronics (littlebirdelectronics.com.au) and Core Electronics (core-electronics. com.au). You only need the 4MB version; make sure you purchase it without header pins, as it must be soldered flush with the PCB. The battery charger socket on the RP2040-Plus is a two-pin Molex PicoBlade with a 1.25mm pitch. The matching plug with attached wires is commonly used in drones and can be purchased from drone suppliers (such as www.dronepartsgarage.com. au). Note that many battery connectors on offer are JST-style connectors, such as JST-SH or JST-XH, which are incompatible. Another way to get a matching connector is to buy a battery on eBay that comes fitted with a PicoBlade connector. You can then cut this off and use it as the charging cable, while the now unterminated battery leads can be soldered directly to the PCB. siliconchip.com.au The LCD is a 3.2-inch panel with a 320×240 pixel resolution using the ILI9341 controller. There are many on offer on eBay and AliExpress, but make sure the vendor’s photo matches Fig.4 (shown at the end of the article), as there are some incompatible designs that will not physically fit. You can purchase the display without the touch interface, which would work fine as no games currently use that feature. However, you will only save about a dollar, so you might as well get it regardless. The large, coloured tactile switches have 8mm diameter buttons and can be purchased from Altronics, Jaycar or RMS Components in Australia and New Zealand, as well as international suppliers. We found that the Altronics version had a better ‘clicky’ feel, but your preference might differ. The tactile switches for the start and select functions need a relatively long shaft of around 9mm, with a total height of 13mm (including the button base). These can be found on eBay and AliExpress. Alternatively, you can purchase a longer-shaft version from Altronics (Cat S1119) and trim it to a total height of 13mm. Australia's electronics magazine The volume potentiometer is a standard 16mm logarithmic type sold by Altronics (Cat R2233) and on eBay and AliExpress. The value is not critical; it can be in the range of 10kW to 50kW, but its depth must be less than 10mm to fit in the case, and it should have an 8mm-long knurled shaft as it is used without a knob in this design. The loudspeaker used in this design is the DB Unlimited SW280408-1 (Mouser Cat 497-SW280408-1, DigiKey Cat 2104-SW280408-1-ND). This was chosen as it’s small but has decent sound quality and is easy to mount using four small screws. Even if you don’t have a 3D printer, getting custom-designed 3D-printed case pieces is relatively easy. The two STL files defining the top and bottom halves of the case can be downloaded from the Silicon Chip website and sent off for fabrication. There are numerous online 3D printing services but we recommend JLCPCB. You only need to upload the files to their website and select their SLA process using LEDO 6060 resin (https://jlc3dp.com/3d-printingquote). They will then make and ship the case to you within a few days. The 6060 resin is strong, with no warping, and the surface is smooth in a slightly translucent off-white colour. However, note that this material can yellow slightly with age, so you might want to spray paint it. The 6060 resin readily accepts paint. An ideal paint for this purpose is Rust-Oleum Satin 2X Ultra Cover, available from Bunnings in many colours. Alternatively, you could use one of JLCPCB’s more expensive materials that are dyed or otherwise immune to yellowing, for example, “Black Resin” or “Imagine Black”. We offer one of those options in our kits for those who don’t want to mess around with paint and like the ‘stealthy’ appearance. Construction Only a few components are involved in the Pico Gamer, so construction can be completed in an hour or two. Four components (the RP2040-Plus, battery, volume potentiometer and speaker) mount on the rear of the PCB, with the rest on the front side. The PCB is marked FRONT and BACK to help with the orientation. The Pico Gamer PCB is coded 08104241 and measures 188 × 80mm. April 2024  39 Parts List – Pico Gamer 1 double-sided PCB coded 08104241, 188 × 80mm 1 custom 3D-printed case in two pieces (upper and lower), 199×90×26mm (see text) 1 Waveshare RP2040-Plus module with 4MB or 16MB flash memory, without header pins [Waveshare SKU 20290 (4MB) or 23503 (16MB)] 1 3.2in LCD touchscreen, 320×240 pixels, with ILI9341 controller and SD card socket 1 900-1100mAh 3.7V LiPo cell [Altronics S4724] 1 SSM2211SZ 1.5W audio amplifier, SOIC-8 (IC1) [DigiKey, Mouser, RS] 6 SPST momentary tactile switches with 8mm diameter buttons, 5×5mm pitch, in various colours (S1-S4, S7, S8) [Altronics S1094/5/6/8/9 or Jaycar SP0720/1/2/3/4] 2 SPST momentary tactile switches, 4×6mm pitch, 13mm height (S5, S6) 1 PCB-mount miniature DPDT slide switch (S9) [Altronics S2060, Jaycar SS0823] 1 DB Unlimited SW280408-1 8W loudspeaker [Mouser 497-SW280408-1, DigiKey 2104-SW280408-1-ND] 1 10kW logarithmic potentiometer with 8mm spline shaft [Altronics R2233] 5 100nF 50V X7R multi-layer (‘monolithic’) ceramic capacitors, 5mm pitch 1 4-pin header, 2.54mm pitch 1 2-pin Molex PicoBlade plug, 1.25mm pitch, with attached leads 4 M3 × 16mm panhead machine screws 4 M2 × 6mm panhead machine screws 1 can of spray paint (optional; see text for recommendations) 1 double-sided foam adhesive tape strip or pad [eg, from Bunnings] Resistors (all 1/4W 1% or 5% axial) 1 27kW 1 18kW 2 330W The PCB fits neatly into the 3D-printed case. When the two halves of the case are screwed together, it has the optimal dimensions for a handheld game console with a smoothly rounded shape that fits well in the hands. During construction, refer to the overlay diagrams, Figs.2 & 3, to see which parts go where. You can also check the photos. Start with the SSM2211SZ audio amplifier chip, which is in a small 8-pin surface mount package that is much easier to fit when no other components are in the way. This mounts on the front side of the PCB and should be soldered using the standard technique for SMD ICs. Apply a little flux paste to the PCB pads and place a small amount of solder on a corner pad. Position and hold down the IC, observing the dot marking pin 1, and tack solder one of the pins using the solder on the pad. Check and correct the IC’s alignment, then tack solder the pin in the opposite corner. With the IC secured, apply more flux paste and, with the bare minimum of solder on your iron, place its tip on the end of each pin, letting the solder flow around the pin and the solder pad. Finally, inspect your work with a strong magnifier (×10 or ×20) and correct any problems with more flux paste and solder-wicking braid. Next, you should install the RP2040Plus on the rear side of the PCB. This sits flush on the PCB, making it a surface-­mounted component. Ensure that it is aligned centrally on the solder pads and that the USB socket is at the top, protruding over the edge of the PCB. The battery charger plug and cable can be soldered now. Note that the colour of the wires (red/black) crimped to the connector might not match the polarity marked on the RP2040-Plus. Check this, and make sure that the lead from the + side of the connector goes to the pad marked + on the PCB regardless of the wire’s colour. Next, fit the resistors and capacitors. There are nine in total, and none are polarised, so installation should be easy. The parts list includes resistor colour codes, but you can also use a DMM set to measure ohms to verify their values. Installing the LCD screen 40 With its custom 3D-printed case, the Pico Gamer is a professional-looking game console. It comes with nine games, including some inspired by Pac-Man, Space Invaders and Tetris, that work well with its colourful 3.2-inch LCD screen. The inbuilt rechargeable battery lets you play for up to eight hours at a time. The next component to install should be the LCD panel. For height reasons, it is not socketed; instead, the pin headers go through the holes in the PCB and are soldered on the other side. These displays are notoriously Australia's electronics magazine siliconchip.com.au Silicon Chip sensitive to static discharge, so make sure that you ground yourself before unwrapping it and avoid handling it too much, especially its connecting pins. Most LCD panels are supplied with the main connector header pins installed, but you will need to add a four-pin header for the SD card interface in the locations marked SD-CS etc. Then insert the LCD panel into position on the front side of the PCB and push it down until it is flush with the PCB. Turn the PCB over and temporarily place it in the top section of the 3D-printed case, ensuring it sits correctly on the four mounting pillars. Next, push down on the LCD screen’s header pins until the LCD glass is flush with the case’s front bezel. You can then solder and trim the pins. The reason for this operation is to ensure that the LCD’s glass will sit flush with the front bezel while compensating for minor variations in the 3D printing of the case. Don’t force the LCD hard against the case, as that could interfere with the touch function; a flush contact is all that is required. Next, fit the volume potentiometer by inserting it through the back of the board, with its locating pin in the hole provided, then tighten the supplied nut over the washer to hold it in place. After that, bend the solder tabs towards the PCB and directly solder them to the pads provided. Now attach the speaker to the rear of the PCB, with the front of the speaker cone facing through the hole. The speaker is held in place by four M2 machine screws inserted from the front side of the PCB which self-tap into the speaker’s mounting holes; nuts and washers are not required. Once it is securely in place, solder its two wires to the nearby terminals. After that, mount the coloured button switches, the long shaft tactile Figs.2 & 3: there are components mounted on both sides of the board. As there are not too many, it shouldn’t take long to assemble. They are all pretty easy; IC1 is surface mounting, but its pins are wide enough to be soldered individually. siliconchip.com.au Australia's electronics magazine April 2024  41 switches and the power switch, all on the front of the PCB. You can use whatever coloured buttons you want; our kits will come with the same set shown in the photo below. If you order the kit with the dark grey/black case, the black button will be white instead for better contrast. The battery is soldered last. Secure it in its marked position on the rear of the PCB using double-sided adhesive foam tape. Kits will include a rectangular pad that might need to be cut down if it’s too large. The battery (cell) will typically come with a connector that needs to be cut off and the leads directly soldered to the PCB. Remember that the battery will be supplied partially charged, so do not accidentally short its leads when trimming them (cut them separately) and ensure that the power switch is in its off position before soldering the battery to the PCB. Also ensure that one lead doesn’t accidentally come in contact with the opposite lead or pad during soldering. Before installing the PCB in the case, if you have the off-white (6060 resin) case, both halves can be spray-painted in your choice of colour. This allows you to customise the case and protects the plastic from the environment so it won’t go yellow over time. The two halves of the case are held together by four 16mm-long M3 On the rear of the Pico Gamer is the USB Type-C connector for charging or connecting to a desktop computer for firmware updates and writing games. There is also a full-size SD card slot for extra game storage (microSD cards can be used with commonly available adaptors). machine screws inserted in the bottom half of the case that self-tap into the plastic of the top case. This works well, but it is not strong enough to survive repeated disassembly, so make sure that you test the completed PCB before you screw the case together. Loading the firmware Installing the firmware on the Pico Gamer is easy. All you need to do is press the left-hand button (marked Boot) on the RP2040-Plus and plug the USB interface into your desktop or laptop computer while holding down that button. The RP2040-Plus will connect to your computer and imitate a USB flash memory drive. Most computers will then open a file management window showing the contents of this drive (which you can ignore). The Pico Gamer firmware file can be downloaded from siliconchip.au/ Shop/6/370 It will have a filename similar to “PicoGamerV1-2.uf2”. There will be two versions, one for 4MB modules and one for 16MB, so select the appropriate one for your build. Drag and drop that file into the imitation USB drive created by the RP2040-Plus. When the copy has finished, your Pico Gamer will reboot and display the main menu. The firmware file you uploaded contains everything needed, including the BASIC interpreter with all the necessary options set, the menu program stored in flash slot 1 and the internal file system with all the games and their supporting files (images and music). There is nothing extra that you need to install or configure. Just start playing. In the future, you can update the firmware without opening the case by connecting the USB socket to a desktop or laptop computer and, using a terminal emulator, interrupt the running program by pressing CTRL-C, then enter the following command: UPDATE FIRMWARE This will have the same effect as disassembling the case and holding The original colour of the case is white as shown in this photo. The case in the lead photo was spray painted in the “Satin Claret Wine” colour. For the buttons, you can choose whatever colours take your fancy. This main menu is displayed immediately after powering on the Pico Gamer. The up/down buttons allow you to select a game and pressing SELECT will run it. If you choose a directory, the contents of that will be displayed instead. When an SD card is inserted, you will have the option of playing games from it too. 42 Silicon Chip Australia's electronics magazine siliconchip.com.au the Boot button on the RP2040-Plus. Using the Pico Gamer The first thing that you need to do is charge the battery. To do this, connect the USB socket on the rear of the console to a charger via a USB-C cable and switch the Pico Gamer on. The charging time from completely flat is about four hours. When the Pico Gamer is running on battery and the menu is displayed, an estimate of the battery’s charge (high, medium or low) will be displayed on the bottom line of the main menu. When you turn the Pico Gamer off, the battery is completely disconnected so that it will keep its charge for a long time if it is not used (a year or two). Because the battery is disconnected when the device is off, it will only charge when the device is switched on and plugged into power. Also on the rear of the case is the slot for a full-size SD card. Cards up to 32GB formatted in FAT16 or FAT32 can be used, and when a card is inserted, the main menu will show an option for selecting it (button B). When the SD card is selected, the menu system will show the directories and executable files on it in the same format as the internal file system. The A button allows you to swap back to the internal file system if needed. Whenever the Pico Gamer is powered up, it will run the menu program (in flash slot 1) and display the main menu. Using the menu is intuitive – you use the up/down buttons to select a game or program and press select (SEL) to run it. Subdirectories are also shown in the menu list, and if you choose one of them, it will show the contents of that directory. In most games and within the menu, the select (SEL) button on the front (under the LCD screen) is used to select an option or exit the current mode. The START button is generally used to start a game running or pause it if running, although that can differ between games. The functions of the other buttons are defined by the game. Typically, the four navigation buttons (on the left) are used to move in various directions, while the A and B buttons (on the right) fire guns, drop bombs or perform other similar functions. The easiest way to permanently install a new game is to copy it to an SD card and insert the card into the siliconchip.com.au The 3D-printed case While a few Silicon Chip projects have used a custom 3D-printed case before, this is the largest and most complicated one so far. The good news is that, besides being able to get the case in kits, companies also exist that can do the printing for you. And because they use large industrial machines and a wide range of materials, they can do a great job. In the past, we would make our own PCBs at home, including the cutThis ting, etching and drilling. case was Few people would do that made by these days because commercial JLCPCB using companies do such a good job fabriStereolithography cating PCBs at a very competitive price. (SLA) and the 3D printing is starting to go the same way. LEDO 6060 resin. A custom case has many advantages over buying a standard ABS plastic box. For a start, it has the optimal dimensions for the design, and it can have a smoothly rounded, ergonomic shape. It can also have the correct holes and cutouts precisely positioned, and they will be perfectly formed – not the jagged mess that can happen when they are cut by hand. Another benefit is the thin and professional bezel around the LCD panel. That has long bedevilled designs incorporating an LCD panel – achieving the perfect thin rectangular bezel by hand is tough. However, it can be done easily with a 3D-printed case. A typical medium-sized 3D-printed case will cost $20-50 to make, which is good value given that you get precisely what you want with all the holes and various features properly made for you. Design software If you wish to design your own case, you first need to decide on the 3D modelling software you will use. There are quite a few free packages to choose from. However, many are not quite as intuitive and accomplished as modern PCB design packages. Suitable packages range from Tinkercad, which runs in a browser and is aimed at beginner and educational users, through to more heavy-duty offerings such as Blender. Blender is free and open source; it is very capable and can do almost anything. It also has a very steep learning curve with many ‘gotchas’ and non-intuitive operations that can trip you up. We settled on Blender because we needed to create a very smooth bevel on the corners of the case, and we wanted to position features with a precision of a fraction of a millimetre. However, the steep learning curve caused us to pull out a lot of our hair in the process. If you plan to use Blender to design an instrument case, we recommend this tutorial video as it covers most of what you need to know: https://youtu. be/rN-HMVTB7nk Fabricating the case When you have finished the design, you can export it as an STL file and send it to your fabricator of choice. There are many, both within Australia and overseas. We used JLCPCB in China, who are better known for producing PCBs but now they are moving into 3D printing. They offer quite a few technologies and materials, including 3D printing in metal. We chose their stereolithography (SLA) technology for the prototype, using the LEDO 6060 resin. This is one of the more cost-effective processes, and it produced a perfect result with all the special features positioned with pinpoint accuracy. Australia's electronics magazine April 2024  43 Pico Gamer. Then plug the USB into a desktop or laptop and, using a terminal emulator, interrupt the running program on the Pico Gamer with CTRL-C (full instructions are in the PicoMite User Manual). This will return you to the command prompt, where you can copy the game to the Pico Gamer’s internal file system with the command: COPY “B:filename” TO “A:” To return to the menu, enter: FLASH RUN 1 You will see your new game included in the menu. Writing games One of the best features of the Pico Gamer is that you can write your own games for it. It is not hard to do and can be a great learning experience. Programs are written in the BASIC language, which is easy to learn by design. The version of BASIC running on the Pico Gamer (MMBasic) has many features for displaying graphics and text, playing various sounds (including music) etc. To learn about this, download the PicoMite User Manual from the bottom of https:// geoffg.net/picomite.html There is an active community on The Back Shed Forum for people who are writing games for the Game*Mite and the Pico Gamer and posting them on the forum (www.thebackshed.com/ forum/Microcontrollers). If you write a game, you should join the forum and post your efforts there for others to enjoy. The best way to write your games is to plug the Pico Gamer’s USB port into your desktop or laptop computer. You can then use a terminal emulator program such as Tera Term to gain access to the PicoMite’s console and use the editor built into MMBasic to enter the program. The PicoMite User Manual goes into more detail on how to use the editor; it is a very efficient process with the ability to quickly jump between running the program and editing it. Another method is to use MMEdit, a program that runs on your PC and allows you to edit the program on the PC, then transfer it over USB to the Pico Gamer and run it with a single keypress. MMEdit is written by Jim Hiley in Tasmania and you can download it from www.c-com.com. au/MMedit.htm Detecting button presses When you write a game for the Pico Gamer, you need to keep a couple of things in mind. The first is how to detect a button press. The eight buttons on the Pico Gamer are connected to I/O pins GP8 to GP15 (physical pins 11 to 20) and will pull the pin low (ie, logic zero) when pressed. The first thing that your program needs to do is configure these pins as digital inputs with internal pullup resistors. For example: For i = 11 To 20 On Error Skip SetPin i, Din, PullUp Next i The “On Error Skip” command is necessary because some pin numbers in the range are ground pins, and MMBasic will throw an error when we try to configure them (or you could change the code to avoid the SetPin command for i=13 and i=18). To detect which button has been pressed, you can define a series of constants representing the pin numbers like this: Const bDOWN = 11 Const bLEFT = 12 Const bUP = 14 Const bRIGHT = 15 Const bSELECT = 16 Const bSTART = 17 Const bB = 19 Const bA = 20 Then, in your program, it is easy to determine if a button is pressed (pulled to a low level). For example: If Pin(bDOWN) = 0 Then ‘down button pressed If Pin(bLEFT) = 0 Then ‘left button pressed Exiting to the main menu The second feature that all programs must implement is to return control to the main menu when the user has finished playing and wants to exit. To do this, you need to insert the following command in your program: Flash Run 1 Fig.4: this is the LCD you should purchase for the Pico Gamer. They are available on eBay and AliExpress, but check that the vendor’s photo matches this image, as some incompatible designs on offer will not physically fit. The front of our display reads “HR4 8637S G6/2” along the touchscreen. MMBasic will immediately transfer control back to the menu program in slot 1 when this command is encountered. The final step is to install your program on the Pico Gamer. To do this, you simply copy it as a file to the directory called /GameMite in drive A:, ie, the internal file. You can use the XModem command or copy the file to an SD card and use that to transfer the file to the Pico Gamer. When the main menu program runs, it will scan drive A:, discover the new program and include it in the menu. So there you go, a modern handheld game console that encourages you to write your own games. For software updates, keep an eye on: http://geoffg. net/picogamer.html SC Australia's electronics magazine siliconchip.com.au 44 Silicon Chip