Silicon ChipUSB to PS/2 Keyboard Adaptors - January 2024 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Feature: Smart Home Automation by Dr David Maddison
  4. Project: Raspberry Pi Clock Radio, Pt1 by Stefan Keller-Tuberg
  5. Feature: WiFi Relay Modules by Tim Blythman
  6. Project: USB to PS/2 Keyboard Adaptors by Tim Blythman
  7. Feature: 4-digit, 14-segment LED Module by Jim Rowe
  8. Project: Secure Remote Switch, Pt2 by John Clarke
  9. Project: Multi-Channel Volume Control Part 2 by Tim Blythman
  10. Serviceman's Log: Getting amped up by Dave Thompson
  11. PartShop
  12. Vintage Radio: Restoring the Vintage QUAD 303 by Jim Greig
  13. Subscriptions
  14. Market Centre
  15. Advertising Index
  16. Notes & Errata: 1kW+ Class-D Amplifier Pt2 / Coin Cell Emulator / Modem/Router Watchdog
  17. Outer Back Cover

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

You can view 35 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 "Raspberry Pi Clock Radio, Pt1":
  • Raspberry Pi Clock Radio main PCB [19101241] (AUD $12.50)
  • Raspberry Pi Clock Radio display PCB [19101242] (AUD $7.50)
  • Software for the Raspberry Pi based Clock Radio (Free)
  • Raspberry Pi Clock Radio PCB patterns (PDF download) [19101241-2] (Free)
Articles in this series:
  • Raspberry Pi Clock Radio, Pt1 (January 2024)
  • Raspberry Pi Clock Radio, Pt1 (January 2024)
  • Raspberry Pi Clock Radio, Pt2 (February 2024)
  • Raspberry Pi Clock Radio, Pt2 (February 2024)
  • Raspberry Pi-based Clock Radio, part two (January 2025)
  • Raspberry Pi-based Clock Radio, part two (January 2025)
Items relevant to "WiFi Relay Modules":
  • Software for WiFi Relay Modules (Free)
Items relevant to "USB to PS/2 Keyboard Adaptors":
  • USB keyboard Adaptor for VGA PicoMite PCB [07111231] (AUD $2.50)
  • ps2x2pico PS/2 Adaptor PCB [07111232] (AUD $2.50)
  • PS/2 male-to-male cable (6-pin mini-DIN) (Component, AUD $10.00)
  • USB Keyboard Adaptor for VGA PicoMite short-form kit (Component, AUD $30.00)
  • ps2x2pico PS/2 Adaptor kit (Component, AUD $32.50)
  • Software for the USB to PS/2 Keyboard and Mouse Adaptors (Free)
  • USB to PS/2 Keyboard and Mouse Adaptors PCB patterns (PDF download) [07111231-2] (Free)
  • Panel labels and cutting diagrams for the USB to PS/2 Keyboard and Mouse Adaptors (Panel Artwork, Free)
Items relevant to "Secure Remote Switch, Pt2":
  • Secure Remote Switch receiver PCB [10109231] (AUD $5.00)
  • Secure Remote Switch transmitter PCB [10109232] (AUD $2.50)
  • Secure Remote Switch transmitter PCB [10109233] (AUD $2.50)
  • PIC16F1459-I/P programmed for the Secure Remote Switch receiver (1010923R.HEX) (Programmed Microcontroller, AUD $10.00)
  • PIC16LF15323-I/SL programmed for the Secure Remote Switch transmitter (1010923A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Secure Remote Switch receiver short-form kit (Component, AUD $35.00)
  • Secure Remote Switch transmitter short-form kit (module version) (Component, AUD $15.00)
  • Secure Remote Switch transmitter complete kit (discrete version) (Component, AUD $20.00)
  • Firmware (ASM and HEX) files for the Secure Remote Switch (Software, Free)
  • Secure Remote Switch PCB patterns (PDF download) [10109231-3] (Free)
  • Panel labels for the Secure Remote Switch (Panel Artwork, Free)
Articles in this series:
  • Secure Remote Switch, Pt1 (December 2023)
  • Secure Remote Switch, Pt1 (December 2023)
  • Secure Remote Switch, Pt2 (January 2024)
  • Secure Remote Switch, Pt2 (January 2024)
Items relevant to "Multi-Channel Volume Control Part 2":
  • Multi-channel Volume Control volume PCB [01111221] (AUD $5.00)
  • Multi-channel Volume Control control PCB [01111222] (AUD $5.00)
  • Multi-channel Volume Control OLED PCB [01111223] (AUD $3.00)
  • PIC16F18146-I/SO programmed for the Multi-Channel Volume Control [0111122B.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC16F15224-I/SL programmed for the Multi-Channel Volume Control [0111122C.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)
  • 2.8-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $25.00)
  • Multi-channel Volume Control control module kit (Component, AUD $50.00)
  • Multi-channel Volume Control volume module kit (Component, AUD $55.00)
  • Multi-channel Volume Control OLED module kit (Component, AUD $25.00)
  • Firmware (C and HEX) files for the Multi-Channel Volume Control (Software, Free)
  • Multi-channel Volume Control PCB patterns (PDF download) [01111221-3] (Free)
Articles in this series:
  • Multi-Channel Volume Control, Pt1 (December 2023)
  • Multi-Channel Volume Control, Pt1 (December 2023)
  • Multi-Channel Volume Control Part 2 (January 2024)
  • Multi-Channel Volume Control Part 2 (January 2024)
  • Multi-Channel Volume Control, part one (November 2024)
  • Multi-Channel Volume Control, part one (November 2024)
  • Multi-Channel Volume Control, Part 2 (December 2024)
  • Multi-Channel Volume Control, Part 2 (December 2024)

Purchase a printed copy of this issue for $12.50.

U S B ▶ P S / 2 Keyboard Adaptor Numerous devices still use PS/2 keyboards, even though USB keyboards have been around for 20 years. That’s because PS/2 is very easy to interface with a microcontroller, so kit-built computers like the VGA PicoMite include a PS/2 keyboard interface. This Adaptor allows you to connect a USB keyboard to a VGA PicoMite or anything else that needs a PS/2 keyboard. By Tim Blythman W hile it’s still possible to buy PS/2 keyboards, they aren’t as widespread as they used to be. USB keyboards often have better features, and wireless USB keyboards are pretty cheap these days. Wireless PS/2 keyboards exist but are no longer common, making this Adaptor especially useful. We recently came across a nice design that is based on a Raspberry Pi Pico microcontroller module. It allows a USB keyboard and mouse to connect to a computer that expects a PS/2 keyboard and mouse; see https://github. com/No0ne/ps2x2pico The hardware presented there is not much more than a Pico board, a level shifter board and some flying leads. We decided to develop a slightly slicker design that would be more - VGA PicoMite version kit (SC6861, $30) - ps2x2pico version kit (SC6864, $32.50) Both kits include everything except the Jiffy box and 6-pin mini-DIN to mini-DIN cable. The mounting hardware and optional headers/sockets are present. The Pico is supplied blank and requires programming. 6-pin mini-DIN cable (SC6869, $10): 1.5m long PS/2 cable. Two cables are required if using both the keyboard and mouse. 52 Silicon Chip Image Source: https://unsplash.com/photos/ZByWaPXD2fU robust and easy to use with the VGA PicoMite (July 2022; siliconchip.au/ Article/15382). We’re presenting two designs here, with one designed specifically to work with the VGA PicoMite. It should also work fine with any computer system that expects a PS/2 keyboard, including older PCs and boot-to-BASIC computers such as the MaxiMite or Colour MaxiMite. This project was also prompted by enquiries about the USB Mouse and Keyboard Interface for Micros (February 2019; siliconchip.au/ Article/11414), asking us to add a PS/2 interface. The PS/2 keyboard protocol “PS/2” refers to the IBM Personal System/2 computer that introduced this interface. The physical side of the PS/2 protocol is quite simple and consists of two lines that are normally pulled up to 5V. The connected devices (eg, keyboard and host computer) can either leave the lines high or pull them down to 0V using a transistor collector/drain. This allows communications in both directions without conflict. Australia's electronics magazine The lines are called CLOCK and DATA, and electrically, the protocol is very similar to I2C. Each byte is sent on the DATA line as a start bit (0), eight bits, an odd parity bit, then a high stop bit. The level on the DATA line is much the same as would be seen on an asynchronous serial line using the ‘8O1’ (eight data bits, odd parity, one stop bit) setting. However, there is a CLOCK line, which is specified as operating at 10-16.7kHz, so it is a synchronous protocol. The keyboard always provides the CLOCK signal, and the only time the host controls it is to briefly pulse it low to signal that it wants to send data. When the host sends its data, it depends on the keyboard to drive the clock signal as the host drives the DATA line. Some of the commands the host can send include those to set the lock key LEDs (Caps Lock, Num Lock & Scroll Lock) and to set the ‘typematic’ rate and delay. Typematic is the term for automatic key press repeats when keys are held down. Since USB keyboards do not implement typematic, we need to emulate that feature. The host can also query the keyboard siliconchip.com.au The PCB shown at left fits into the VGA PicoMite case and replaces the PS/2 socket with its USB socket. Six pin headers connect the two PCBs. The construction is a bit fiddly, but the tidy result is worth the effort. The PCB shown at right is the ps2x2pico version and has more features such as a mouse adaptor. Due to its larger size, it needs to be fit into a UB5 Jiffy box, but it can convert a USB keyboard/mouse combo to work with two PS/2 ports and it supports wireless USB devices. about its status and identity. For the most part, though, data is sent from the keyboard to the host when keys are pressed or released. The PS/2 ‘scancodes’ that the keyboard sends do not neatly map to anything like the ASCII codes or the USB scancodes sent by USB keyboards. In fact, PS/2 scancodes correspond to the original physical location of the keys on the keyboard, as adjacent keys often have similar codes. The mapping was clearly chosen to simplify the scanning and encoding of keys by the keyboard, leaving the hard work of decoding the scancodes to software on the host computer. A PS/2 mouse works similarly, although it sends button presses and movement changes instead of scancodes. The host can command it to set parameters like sampling (update) rate and scaling. So, apart from the scancode interpretation that is needed, the PS/2 protocol is fairly simple and is easy enough to implement as it is driven by the keyboard. We can control the clock rate since we are trying to emulate a keyboard. Circuit details As mentioned earlier, the first circuit is specifically designed to work with the VGA PicoMite. A second circuit siliconchip.com.au is intended to match the circuit used by No0ne’s ps2x2pico software. PCBs are available for both. Electrically, both are very simple, and most components are present to interface a 3.3V Pico microcontroller board to the 5V levels used by the PS/2 interface. Each circuit has a corresponding PCB; we will describe their differing software and construction later. We think the first version (Fig.1) is the best choice if you want to connect a USB keyboard to a VGA PicoMite. However, if you’re going to interface to an old PC with both PS/2 mouse and keyboard connections, we recommend building the second version. VGA PicoMite version Fig.1 shows the circuit for this version of the Adaptor. It uses a Raspberry Pi Pico microcontroller board (MOD1), a pair of USB connectors (CON1 and CON2), a 6-pin mini-DIN socket (as used for PS/2), CON3, and a few other components. USB sockets CON1 and CON2 are connected in parallel. Those who know USB will realise that both connectors cannot be used simultaneously; they are alternatives, and only The Adaptor is a neat install in a VGA Picomite, replacing the PS/2 socket with a USB socket. Australia's electronics magazine January 2024  53 Fig.1: Q1 & Q2 act as voltage level converters connecting the 5V PS/2 bus to the 3.3V Pico. That allows the Pico software to convert signals from a USB keyboard to the PS/2 protocol. CON1 and CON2 give two different mounting locations for the USB socket. one should be fitted. They are the same socket type (both type A) but are in different locations on the PCB to suit various applications. The data lines from CON1 (or CON2) head via 22W resistors to consecutive pins on MOD1. Although the RP2040 chip on the Pico has native support for USB, some clever people have written a library that uses the Pico’s PIO (programmable input/output) peripheral as a USB controller. The general-­ purpose I/O pins do not have internal 22W resistors as required for USB communications, hence our adding them. Two more of the Pico’s pins (carrying the CLOCK and DATA signals) connect to a level-shifting arrangement based on 10kW resistors and Mosfets Q1 and Q2. An identical arrangement is used on the VGA PicoMite to interface the 3.3V Pico to the 5V levels used on the PS/2 bus. This configuration is well-suited to voltage level conversion on open-­ collector busses and is commonly used with I2C interfaces. The resistors pull up the lines on each side to either 3.3V or 5V. The gate is at the same voltage as the source, so the Mosfet’s channel is off, and its body diode is reverse-­ biased due to the 5V rail being higher than the 3.3V rail. If the 3.3V logic line (connected to the Mosfet source) is pulled down, the gate is at a higher voltage than the source and the Mosfet switches on, propagating the low level to the 5V 54 Silicon Chip logic side. If the 5V logic line goes low, the source is pulled down via the Mosfet’s body diode, the Mosfet switches on, and the low level is also seen on the 3.3V side. Releasing the low level allows the source to rise until the Mosfet switches off and each side returns to its initial state, with both sides pulled up by their respective resistors. One more pin of the Pico is connected to a 1kW resistor and then to ground via the LED. The latter is a status indicator, with the LED lit by bringing the digital pin high. The 5V pins of all the connectors are tied together so that any connector can supply 5V as needed. Since CON1 (or CON2) is a host USB-A port, it will power a downstream USB device like a keyboard. In normal operation, power will come from CON3, since it will be connected to a PS/2 host. If necessary, power could be provided to the circuit via the Pico’s USB socket. The Pico has an integrated 3.3V regulator, with its output available at the 3V3 OUT pin. In this case, it is only used as a reference voltage for the level-shifting circuitry. The ps2x2pico version Fig.2 shows the second circuit. It has a Pico (MOD1), USB type-A socket (CON1), two 6-pin mini-DIN sockets (CON2 & CON3) and a mini-USB socket (CON4). CON4 only has its power (VBUS & GND) pins connected. Australia's electronics magazine The ps2x2pico name has been coined for the software by its creator, No0ne. We are simply using it to identify the version of the hardware that we have developed to work with their software. The eight 10kW resistors and four Mosfets implement four logic level-­ shifting channels identically to the first circuit. The 5V sides of two channels go to CON2 for a PS/2 keyboard, while the other two connect to CON3 for a PS/2 mouse. The 3.3V sides of the level shifters connect to pins on MOD1, while CON1 connects the USB data lines to a pair of pads. These are intended to be connected to a matching pair of pads on the underside of the Pico, and thus the USB D− and D+ lines on its USB controller. Finally, LED1 and its 1kW ballast resistor connect to another of the Pico’s I/O pins. It’s possible to replace CON1 with a USB-OTG adaptor fitted into the Pico’s micro-USB socket; that is what is shown in the photos at https://github. com/No0ne/ps2x2pico We felt that having fixed sockets made for a more robust solution. The fixed socket arrangements also lend our final PCB design to being installed in a Jiffy box. Software Despite their almost identical functionality, the two circuits use vastly siliconchip.com.au Fig.2: like in Fig.1, many of the components are responsible for interfacing the 3.3V Pico with the 5V PS/2 bus. Those components are duplicated for connections to both a PS/2 keyboard and mouse. The USB data line ‘test’ pads at upper right connect CON1 to the Pico’s USB port. different software implementations. The code at https://github.com/No0ne/ ps2x2pico is built using the Pico’s C SDK (software development kit). It uses the RP2040’s internal USB controller peripheral in host mode, and implements the PS/2 interface using the PIO peripheral. We discussed the PIO peripheral in detail in our Pico review in the December 2021 issue (siliconchip.au/ Article/15125). The PIO is a programmable state machine that can be used emulate many I/O and communications peripherals. Using the internal USB controller in host mode is easier but it also means that the controller cannot operate in device mode, for example, to provide debugging data over a virtual serial port. Plus the USB data connection must be made via the test pads on the Pico, instead of standard header pins. Our software instead uses the PIO to emulate a USB host peripheral based on a library available within the Arduino IDE. Thus, we used the Arduino IDE to build our software. siliconchip.com.au The USB host implementation means that the PIO peripheral cannot provide the PS/2 interface, so we have written it to work using GPIO pins and timer interrupts instead. This timer operates at 50kHz and is divided into four phases to give a nominal 12.5kHz PS/2 clock frequency. Using the Arduino IDE also allows us to customise the code more easily, and we have ensured that it works well with the VGA PicoMite. Some key events require more than one byte to be sent on the PS/2 line, so a queue has been implemented to ensure that data moves in an orderly fashion. It should also guard against brief bursts of keyboard activity overwhelming the Adaptor. As we mentioned, the software must map scancodes from the USB scanset to the PS/2 scanset. We use what is known as Set 2, the default for PS/2 keyboards. The mapping is not quite one-toone. USB keyboards report the state of the modifier keys (Ctrl, Shift, Alt etc) as bits in a status byte rather than as scancode events. So, we have to Australia's electronics magazine convert the changes in these status bits into the key-up and key-down events that PS/2 keyboards generate. Some keys, such as Pause, have odd mappings that must be handled uniquely. That is because the Pause feature was originally invoked by the Ctrl+NumLock key combination, meaning that a single keystroke maps to eight bytes to send on the PS/2 line. The Adaptor must also send repeated key-down events to emulate the typematic feature. With USB keyboards, that is usually handled by the host computer’s software. The ps2x2pico software does not control the LED provided on the second circuit; we simply added it to the PCB in case users wish to modify or update the software to do so. Note that both versions of the software support USB hubs, so if you need to attach a separate keyboard and mouse, you only need to add a hub. If you are using a wireless keyboard and mouse, consider buying them together; in that case, both keyboard and mouse will usually share a single wireless USB receiver. January 2024  55 Parts List – VGA PicoMite USB to PS/2 Converter 1 PCB double-sided PCB coded 07111231, 42 × 66mm 1 Raspberry Pi Pico programmed with 0711123A.UF2 (MOD1) 1 UB5 Jiffy box ● 2 M3 × 10mm panhead machine screws ● 4 M3 hex nuts ● 2 M3 flat washers ● 6 header pins ♦ 1 M3 × 5mm panhead machine screw ♦ 1 M3 × 6mm tapped spacer ♦ 2 20-way pin headers (optional, for MOD1) 2 20-way female header sockets (optional, for MOD1) 1 PCB mount USB-A horizontal socket (CON1 or CON2) 1 6-pin mini-DIN socket (CON3) ● 1 6-pin mini-DIN to 6-pin mini-DIN cable ● Semiconductors 1 3mm green LED (LED1) 2 2N7002 N-channel Mosfets, SOT-23 (Q1, Q2) Resistors (all M3216/1206 SMD, ¼W) 4 10kW 1 1kW 2 22W ● only needed if installing the Adaptor in a Jiffy box ♦ only required if installing the Adaptor inside a VGA PicoMite Hardware The VGA PicoMite version PCB has been designed so it can sit directly above the main PCB of the VGA PicoMite and fit into the VGA Pico­Mite’s recommended case, as shown on page 53. In this configuration, the CON3 PS/2 connector is not fitted, and the corresponding pads on the two PCBs are directly connected with header pins or similar (shown on page 60). There is the option of fitting the USB socket where the PS/2 socket would have been, meaning that you can now plug a USB keyboard in where you would have otherwise plugged a PS/2 keyboard. You could use the other USB socket location instead, although you would need to cut a hole in the side of the VGA PicoMite case to access it. Another option is to mount either PCB inside a UB5 Jiffy box. The assembled PCB is secured to the Jiffy box’s lid. Slots for the various connectors can be made by simply cutting down from the top edge of the box, which is easier than trying to hollow out a shape in the side of the box. In this configuration, the LED should be mounted on the underside of the PCB to allow it to shine through the box lid. We’ll provide more guidance on these options later. Programming the Pico Fig.3: three 3mm holes are needed in the Jiffy box lid to accommodate the PCB coded 07111231. Two are for mounting screws and the third allows the LED to shine through. You could use the blank PCB as a jig to mark out the holes or confirm your measurements. We recommend programming the Pico before fitting it to the board, especially since the ps2x2pico version uses the USB socket normally used for program uploads. Connect the Pico to a computer, holding in the white BOOTSEL button as you do so. A drive labelled RPI-RP2 should appear. Upload the firmware by copying the respective UF2 file to that drive. Use the file “0711123A.UF2” for the VGA PicoMite version. After programming, it will reappear as a virtual USB-serial port, so you can check that such a device appears on your system. Sending a ~ character to that serial port will toggle debugging mode, but you won’t see much of note until it is connected in-circuit. The ps2x2pico version requires the “ps2x2pico.UF2” file. There won’t be any obvious clues that programming has completed except that the drive will disappear. The ps2x2pico version behaves as a USB host, so you shouldn’t see any USB devices. Australia's electronics magazine siliconchip.com.au 56 Silicon Chip That software is under active development, so keep an eye out for updates. We used version 0.7 in our testing and it is included in the software downloads. This software is copyrighted by No0ne and released under an MIT open-source license. In the software bundle, we’ve also provided a PS2_HOST sketch that we used for testing. The bundle includes the UF2 file for this sketch. It is designed to work with the VGA PicoMite version of the hardware, and simply provides a PS/2 host port on the CON3 mini-DIN socket. Communication is via a virtual USB serial port on the Pico (via the micro-USB socket). This software will report any packets received and their equivalent keys (if the device is a keyboard). Host packets can be sent by typing their hexadecimal codes followed by Enter. There is an assortment of PS/2-related links at the bottom of https://github.com/ No0ne/ps2x2pico and some of those list host commands. Construction The first circuit, the VGA Pico­Mite version, corresponds to the PCB coded 07111231 (34 × 65.5mm). The second version that supports both a keyboard and mouse uses a PCB coded 07111232 (48 × 58mm); we will refer to it as the ps2x2pico version. The Keyboard Adaptor can be fitted inside the VGA PicoMite case or a Jiffy box as shown here. This enclosure has the holes made as per Fig.3. To keep everything compact, we’ve primarily used surface-mounting components. You should have tools such as a finetipped iron, tweezers and magnifiers. Useful consumables include solder wire, flux paste and solder-wicking braid. The small PCBs can be held in place with Blu-Tack or similar while soldering (if you don’t have a PCB-holding vice). Having an appropriate solvent on hand is also a good idea, so you can clean up any flux residue left after soldering. If you are building a version to fit into a Jiffy box, you can use the bare PCB to mark out the location of the holes that are needed. That is usually easier than using our drilling and cutting diagrams, although you have that option too. There are two holes for M3 mounting screws in the VGA PicoMite version, plus a 3mm hole for the LED, as shown in Fig.3. The ps2x2pico version uses three mounting holes, plus one LED hole, although the default software does not make use of the LED, so you could omit it. Fig.4 is the cutting and drilling diagram for that version. The screw holes can easily be marked by running a pencil (the thin tip of a 0.7mm mechanical pencil is ideal) around or through the holes. The LED holes can be marked using the two holes through their pads on the PCB. Draw a line between those marks and then a smaller line across the exact middle of the one you drew to find the centre of the LED hole. There are some cuts to be made in the sides of the boxes, which are easily made by using the assembled PCBs as guides while mounted on the lids. Fig.4: the hole at centre left is only needed if the LED is fitted; the other three holes are for mounting the PCB coded 07111232. The cutout regions are necessary to accommodate the various sockets. You might find it easier to remove the red shaded region and glue the tab back in later. siliconchip.com.au Australia's electronics magazine January 2024  57 VGA PicoMite ver. assembly The PCB overlay for this version is shown in Fig.5. Use that and the photo shown opposite as a guide to fitting the parts to the PCB. Before assembling the PCB, if you are going to install it in the VGA PicoMite, carefully break off the two PCB tabs that are attached by ‘mouse bites’. Grasp the main part of the PCB with one hand, then use a pair of wide-nosed pliers to flex and break off the tabs. Do this outside to avoid inhaling any fragments of fibreglass. If you need to use a file to clean up the rough edges of the mouse bites, do that outside too. If you are fitting this PCB to a Jiffy box, one tab is used to help secure the PCB while the other fills the gap in the edge of the box adjacent to the USB socket. Neither is essential to the electrical operation of the circuit. Apply flux to the PCB for the surface mounting components. Place each in their marked locations, using the relevant overlay diagram as a guide, and tack one lead. Check that each component is within their pads before soldering the remaining lead(s). Use your solvent to clean up the PCB after the surface mounting components have been fitted and allow the PCB to dry. Solder LED1 next. There are cathode (K) markings on both sides of the PCB to allow it to be fitted to either side. If you are installing it in the Jiffy box, solder it to the back of the PCB (the side with the Silicon Chip logo). It should be flush against the PCB. If you are fitting it to the VGA PicoMite then solder it to the front of the PCB, with about 10mm of lead between the LED’s body and the PCB. Later, the LED’s leads can be bent to aim it out through the front of the enclosure near the SD card socket. Of course, you should ensure the shorter lead goes to the pin marked K. Now connect the Pico to the PCB; there are three ways to do this. Firstly, you could solder the Pico directly to the PCB. This requires no extra parts but means that the Pico needs to be accurately aligned to the pads on the PCB. You could use M2 screws in the corner holes to temporarily secure the Pico, ensuring correct alignment during soldering. Or you could instead solder pin headers to the Pico (as though you were going to use it on a breadboard). You could then solder female header sockets to the PCB and slot the Pico onto them, or solder the Pico’s headers directly to the PCB. If installing the Adaptor in a Jiffy Box, there are no height requirements that would restrict using headers. The clearance is tighter inside the VGA PicoMite case, so you need to solder the Pico directly to the PCB or use male headers only; using sockets makes the assembly too tall. ps2x2pico ver. construction Fig.6 is the PCB overlay for this Fig.5: assembly of the PCB designed for the VGA PicoMite is straightforward, as there are only 13 components. It’s important to make sure the orientation of the LED and the Pico is correct when attaching those components. 58 Silicon Chip Australia's electronics magazine version. You can use that and the photo shown next to Fig.6 to help you assemble the PCB. To fit out the PCB for the ps2x2pico version, apply flux to the pads for all the surface-mounting components, including CON4, the mini-USB socket. If you only plan to use the default firmware, you can omit the 1kW resistor and the LED, as that firmware will not drive them. If you want to modify the firmware to use the LED, it should be fitted to the rear of the PCB if you are using the Jiffy case. Otherwise, you might like to fit it to the top if you are using the bare board. Place CON4 first and locate it on the PCB with the pegs on its underside. Clean the iron’s tip and apply a small amount of fresh solder. Touch it to the pad on the PCB and the solder should run onto the lead. Use a generous amount of heat and solder to secure the four larger pads that connect to the shell and use the solder wick to draw away any excess solder if there are bridges between the pads. Then fit the four transistors, followed by the eight resistors. With the surface-mounted parts in place, you can clean off the excess flux and allow the PCB to dry. As with the VGA PicoMite version, you can install the Pico directly to the PCB or on headers. An important difference is that the two small pads (TP2 and TP3) on the Pico near its microUSB socket must also be connected to Fig.6: there are a total of 19 components to fit for the ps2x2pico version. The default firmware does not use LED1 and the 1kW resistor, so you can leave them off unless you plan to modify the software. siliconchip.com.au the corresponding pads on the PCB. If you are surface-mounting the Pico, it should be possible to flow solder through the PCB and onto the pads on the Pico. You could tin the pads on the PCB and Pico with a small amount of solder to ensure that surface tension pulls the solder all the way through. If you aren’t sure, the best way to guarantee a good connection is to surface-­mount some short pieces of stiff wire, such as axial lead offcuts, to the underside of the Pico. This will also need to be done if you plan to use headers to mount the Pico; it is what we did, and you can see it in the photo at upper right on page 60. If you are using headers, solder the male headers to the underside of the Pico; the female header sockets are fitted to the top of the PCB. Connect the Pico to the PCB (by soldering the bottom of the male headers or by pressing it into the female headers). The short wire leads should protrude through the pads in the PCB, allowing them to be soldered to it. When that is done, the CON1 USB socket and CON2/CON3 mini-DIN sockets can be fitted. VGA PicoMite version testing To finalise the Jiffy box version of the VGA PicoMite PS/2 Adaptor, solder the CON3 mini-DIN socket, ensuring it is down hard against the PCB. The USB socket can then only be soldered to the CON1 location. The Adaptor should be complete Parts List – ps2x2pico USB to PS/2 Converter 1 double-sided PCB coded 07111232, 58 × 52mm 1 Raspberry Pi Pico programmed with ps2x2pico.UF2 (MOD1) 2 20-way pin headers (optional, for MOD1) 2 20-way female header sockets (optional, for MOD1) 1 PCB mount USB-A horizontal socket (CON1) 2 6-pin mini-DIN sockets (CON2, CON3) 1 surface mounting mini-USB socket (CON4) 1 UB5 Jiffy box 3 M3 × 10mm panhead machine screws 6 M3 hex nuts 3 M3 flat washers 2 short pieces of wire (if mounting the Pico on headers) 2 6-pin mini-DIN to 6-pin mini-DIN cables Semiconductors 1 3mm green LED (LED1; optional) 4 2N7002 N-channel Mosfets, SOT-23 (Q1-Q4) Resistors (all M3216/1206 SMD, ¼W) 8 10kW 1 1kW (only needed it fitting LED) enough to perform a functional test at this stage. Plug a USB keyboard (or USB wireless receiver) into the USB socket and then plug the mini-DIN cable into the mini-DIN socket. Connect the other end of the miniDIN cable to the PS/2 socket of the computer and power it on. After a second or two, you should see the green LED light up. That indicates the Adaptor has recognised that a keyboard is attached. The LED will flicker if either the host computer or keyboard tries to communicate. Although the LED is programmed only to light up if a keyboard is connected, we have seen some wireless mouse receivers that also cause it to happen. We suspect this type of receiver is a generic type that supports both keyboards and mouses and thus enumerates as a keyboard, even though that is not necessary for its operation with a mouse. Jiffy box Drill the two holes in the lid of the Jiffy Box, plus the one for the LED. Thread a machine screw from the outside and secure each with a nut inside. Each nut forms a thin spacer to keep the PCB off the lid. Then thread the PCB over the screws and fasten it in place with washers and screws. ◀ The ps2x2pico version of the PCB is compact and uncomplicated. We omitted the 1kW resistor and the LED from our build as they are not driven by the default firmware. We decided to include them in the design in case constructors want to add support, which should not be too hard. ◀ This is the same VGA PicoMite version as shown on page 53, but built as a standalone board to be fitted into a Jiffy box. In this case, the USB socket can go in the CON1 position as the CON3 mini-DIN socket covers the CON2 position. siliconchip.com.au Australia's electronics magazine January 2024  59 ◀ The headers don’t protrude through the top of the PCB so that the USB socket can be soldered over the top. Using three pairs of 0.1in pin headers means that the individual pins do not come loose during soldering. The plastic has been filed down slightly on the middle pair due to the pad spacing being less than 2.54mm (0.1in) on the mini-DIN socket. We’ve also pushed the plastic shroud so that the pins are only 1.6mm (the PCB thickness) above the shroud. ◀ We used lead offcuts to directly connect the TP2 & TP3 pads on the Pico to the USB pads on the PCB underneath. Even if you are soldering the Pico directly to the PCB, we recommend soldering the two leads to the Pico. You can now make the two U-shaped cutouts in the sides of the box. Either use our cutting diagram, or place the mounted PCB against the box to mark out the sides. The easiest way to make these is to use a fine saw or very sharp knife (such as a hobby knife) to make the vertical cuts. Carefully score the horizontal cut on the outside of the box and then gently flex the tab with a pair of widenosed pliers until it snaps off. The hobby knife can then be used to neaten and fine-tune the shape of the cutouts until the lid slots fully into place. This version is completed by screwing the lid of the Jiffy box in place. Installing in a VGA PicoMite Installing the Adaptor inside the VGA PicoMite is a bit more fiddly, as it requires stacking the PS/2 and USB connectors. You should have already removed the two PCB tabs by snapping them off; do so now if you have not already. Solder the pin headers to the underside of the PCB in the six pads belonging to the mini-DIN connector. Make sure that the headers do not protrude above the PCB at all. We found the easiest way to do this was to separate the pin headers into pairs of two pins and then locate them into adjacent holes. The plastic surrounding the middle pins may need to be filed down a bit to give clearance; unfortunately, the mini-DIN socket does not have VGA PicoMite Build this amazingly capable ‘boot to BASIC’ computer, based on a Raspberry Pi Pico. It has a 16-colour VGA output, a PS/2 keyboard input, runs programs from an SD card and can be quickly built Blocks is a BASIC game that runs on the VGA PicoMite $35 + Postage ∎ Complete Kit (SC6417) ∎ siliconchip.com.au/Shop/20/6417 This kit comes with everything shown (assembly required). The PCB is available in green or blue. You will need a USB power supply, PS/2-capable keyboard (or the kit shown on page 52), VGA monitor and optional SD card. For the circuit and assembly instructions, see the July 2022 issue: siliconchip.au/Article/15367 60 Silicon Chip Australia's electronics magazine siliconchip.com.au Fig.7: this diagram shows modifications to the H0376 instrument case used for the VGA PicoMite. The added LED for the PS/2 Adaptor sits on the front panel near the SD card socket, while the cutout for the USB socket overlaps the original location of the miniDIN socket on the rear panel. a standard 2.54mm (0.1in) pitch between all pins. It helps to slide the pins along the plastic so that only a small amount (about the PCB thickness) protrudes. The photo opposite shows how the PCB looks with the header pins attached. Next, solder the USB socket above the PCB in the location marked CON2 and attach the 6mm spacer next to the LED. The Adaptor PCB can now be slotted onto the VGA PicoMite. Make sure that it is square and does not contact any components underneath. Solder the six pins to join it to the VGA PicoMite’s PCB. You might find that you need to slightly enlarge the back panel hole for the USB socket, since it is larger than the mini-DIN socket. You will also need to drill a hole for the LED in the front panel. Fig.7 shows the suggested panel modifications for those two holes. Connect a USB keyboard, then power on the VGA PicoMite. The LED should light up, then flicker as the PicoMite initialises. ps2x2pico version testing The Adaptor can be tested by connecting it to a PS/2-­compatible computer using a pair of 6-pin mini-DIN cables. Connect the keyboard and mouse to the USB socket using a hub, if necessary. We imagine many people will use a wireless keyboard and mouse combination, in which case a single compact receiver is all that needs to be plugged into the USB socket. The mini-USB socket is provided in case extra power is needed; the socket on the Pico cannot be used to supply power as it is working in host mode. Attach the machine screws to the lid of the Jiffy box and secure them on the inside using three of the nuts. Slide the PCB over the screws, then secure it to the lid with washers and screws. Use the Fig.4 cutting diagram to make the U-shaped slots in the side of the Jiffy box to accommodate the connectors. A sharp hobby knife or fine-toothed saw are good choices here. Finally, attach the lid to the box with its included screws. Jiffy box labels Figs.8 & 9 show panel artwork that can be applied to the lids of the Jiffy boxes. Fig.9 helpfully marks the distinction between the keyboard and mouse sockets. Conclusion We continue to be impressed by the capabilities of the Raspberry Pi Pico, and this application is a perfect use for its abilities. We’re sure there are many readers out there with PS/2 equipment who will make use of the option to use a modern USB keyboard on their legacy devices. You can find a list of helpful links listed below: • github.com/No0ne/ps2x2pico/ • wiki.osdev.org/PS/2_Keyboard • wiki.osdev.org/PS/2_Mouse SC Figs.8 & 9: this simple label (shown at left) can be affixed to the top of the Jiffy box for the VGA PicoMite Adaptor. While the label shown at right will help users differentiate between the otherwise identical mouse and keyboard sockets. We’ve omitted the hole for the LED as we expect most readers will not use it. Both labels are shown at actual size. siliconchip.com.au Australia's electronics magazine January 2024  61