A ZX Spectrum with a Microdrive emulator plugged into its expansion port

A Modern Replacement For The ZX Spectrum’s Odd Tape Storage System

Unless you were lucky enough to be able to afford a floppy disk drive, you probably used cassette tapes to store programs and data if you used pretty much any home computer in the 1980s. ZX Spectrum users, however, had another option in the form of the Microdrive. This was a rather unusual continuous-loop mini-tape cartridge that could store around 100 kB and load it at lightning speed, all at a much lower price point than a floppy drive. The low price came at the cost of poor durability however, and after four decades it’s becoming harder and harder to find cartridges that work reliably. [Derek Fountain] therefore set out to make a modern Microdrive emulator that stores data on SD cards.

Several projects already exist to replace Microdrives, but they typically also need the ZX Interface 1, a serial/network expansion module that’s becoming equally hard to find. Hence [Derek]’s choice to make his emulator a completely standalone system that directly plugs into the Spectrum’s expansion port.

A 3D-printed box with a PCB inside holding three Raspberry Pi Picos and an SD cardThe system is housed in a 3D-printed enclosure that holds two PCBs. Three Raspberry Pi Picos run the show inside: one to hold the ZX Interface 1’s ROM image and interface with the Spectrum’s bus, another to simulate the Microdrive, and a third to run the user interface and communicate with the SD card. The user can choose between eight tape images stored in .MDR format by using two pushbuttons and a rotary encoder, with a small OLED display showing the machine’s configuration.

While you might think that three dual-core 133 MHz ARM CPUs would run circles around the Spectrum’s Z80, it actually took quite a bit of work to get everyting running properly in real time. The 3.5 MHz bus clock rate gave the second Pico precious little time to fetch the required bytes out of its flash memory. Its RAM was fast enough for that, but too small to hold all eight tape images at the same time. In the end, [Derek] settled on using a separate 8 MB SPI DRAM chip that could easily keep up the data rate, with the Pi just using its GPIO ports to shuttle the data around.

All source code and extensive documentation are available on Derek’s excellent blog post and GitHub page. Be sure to also check out [Jenny]’s detailed review and teardown if you’d like to know more about the weird and wonderful Microdrive system.

Thanks for the tip, [Andrew]! Continue reading “A Modern Replacement For The ZX Spectrum’s Odd Tape Storage System”

two USBValve devices on a table, both with a USB cable plugged in. The top one with a long narrow OLED display and the bottom one with a 128x64 OLED display.

Sleuth Untrusted USB Communication With USBValve

USB devices are now ubiquitous and, from an information security standpoint, this is a terrifying prospect as malicious software can potentially be injected into a system by plugging in a compromised USB stick. To help get some piece of mind, [Cesare Pizzi] created USBValve to help expose suspicious USB activity on the fly.

The idea behind USBValve is to have the onboard microcontroller advertise itself as a storage device, pretending to have a filesystem with some common files available. When an unknown USB device is first inserted into the USB port on the USBValve tool, USBValve displays usage information, via the attached OLED screen, on whether the USB device is accessing files it shouldn’t be or immediately trying to write to the filesystem, which is a clear sign of malicious behavior.

The USBValve hardware is a straight forward composition of a Raspberry Pi Pico, an tiny I2C OLED screen and an optional PCB carrier board with a 3D printed spacer. The software uses Adafruit’s Tiny USB library along with the SSD1306AsciiWire library to drive the OLED display. And it’s all open source, including the code and PCB design files.

There’s a lot of security fun to be had with USB, from DIY dirt cheap Rubber Duckies to open source hardware Rubber Duckies, to discussions on the BadUSB exploits. The simplicity of the USBValve project allows it to be low cost, easy to use and can provide concise, critical information for a variety of real world threats.

After the break, be sure to check out [Cesare Pizzi]’s talk about USBValve at the SCC Insomnihack conference which has a wealth of information on how it fares against some known malware attacks, discussions on some of its shortcomings and potential avenues for improvement.

Thanks to [watchdog] for the tip!

Continue reading “Sleuth Untrusted USB Communication With USBValve”

PicoDebugger Makes Development Easier

Debugging a Raspberry Pi Pico is straightforward enough; it simply involves hooking up something up to the USB and SWD pins. [Mark Stevens] whipped up the PicoDebugger to make this job easier than ever before.

The Raspberry Pi Foundation developed the Picoprobe system to allow a RP2040 to act as a USB to SWD and UART bridge for debugging another Pico or RP2040. The problem is that hooking it up time and time again can be fussy and frustrating.

To get around this, [Mark] whipped up the PicoDebugger board, which directly connects most of the important pins for you. Drop a Pico into the “Target” slot, and you can hook up the PicoDebugger to its UART lines with the flick of a DIP switch. The SWD pins can then also be connected via jumpers if so desired.  It also features a 2×20-pin header to allow the target to be wired into other hardware as necessary.

It’s a neat project, and it certainly beats running a bird’s nest of jumper wires every time you want to debug a Pico project. Simply dropping a board in is much more desirable.

We’ve seen some other neat debug tools over the years, too. If you’ve got your own development productivity hacks in the works, don’t hesitate to let us know!

Picopad Is A New Open Source Game Console

Microcontrollers are so powerful these days that you can build color handheld games with them that match or exceed what you’d ever get on the Game Boys and Game Gears of yesteryear. The Picopad aims to offer just this, in an open-source hackable format that’s friendly to experimenters.

As you might have guessed from the name, the Picopad is based on the Raspberry Pi Pico and its RP2040 microcontroller. It features four face buttons and a D-pad, along with a small color LCD with a 320×240 resolution. There is also a microSD slot upon which programs can be stored, and also an expansion port with headers for a variety of IO from the RP2040 itself including both GPIOs, serial, I2C and analog input pins. The housing is constructed out of PCBs, with some cheerful gaming artwork adding a fun aesthetic. Development is via a custom C SDK, with support for Micropython as well.

If you want to build your own and don’t fancy starting from scratch, kits are available online. We’ve seen some other great gaming experiments with the Raspberry Pi Pico before, too, like an open-world 3D game and ZX Spectrum emulators. Video after the break.

Continue reading “Picopad Is A New Open Source Game Console”

A BASIC Interpreter For The Raspberry Pi Pico

It’s pretty easy to program the Raspberry Pi Pico in Python, or you can use C or C++ if you so desire. However, if you fancy the easy language of yesteryear, you might like PiccoloBASIC from [Gary Sims].

Putting it simply, piccoloBASIC is a BASIC interpreter that runs on the Raspberry Pi Pico. It features all the good bits of BASIC such as GOTO and GOSUB commands, that fancier languages kind of look down upon. It’s also got enough built-in routines to handle regular programming life, like sleeps, delays, a basic pseudorandom number source, trigonometric functions, and the ability to deal with floating point numbers. As far as microcontroller tasks go, it’s got rudimentary support for talking to GPIOs right now via the pinon and pinoff commands. However, it’s probably not the way to go if you want to bit-bang an SD card to within an inch of its speed rating.

Down the road, [Gary] hopes to add support for features like the Pico’s I2C, SPI, and PIO hardware, along with networking protocols and Bluetooth. PEEK and POKE are also hopefully on the way for those that like to fiddle with memory directly.

Meanwhile, if you’re looking for a different yet similar take, explore the port of MMBasic to the Pico platform. Video after the break.

Continue reading “A BASIC Interpreter For The Raspberry Pi Pico”

A Pico-Based ZX Spectrum Emulator

The ZX Spectrum was a popular computer of the 8-bit era. Now, it’s possible to emulate this machine on a microcontroller so cheap that it’s literally been given away on the front cover of magazines. Yes, we’re talking about the Pico ZX Spectrum project.

The project consists of all the necessary code to emulate a ZX Spectrum upon the hardware of the RP2040 microcontroller that makes up the Raspberry Pi Pico. The community has then taken this code and run with it, using it as the basis for all manner of different ZX Spectrum builds. If so desired, you can go barebones and use the Pico to run a ZX Spectrum off a breadboard with HDMI video output. Alternatively, you can build something like the PicoZX from [Bobricius]. The handheld computer features a PCB-based housing, along with an LCD and an integrated keyboard. Other configurations support features like USB keyboards, VGA outputs, and working sound output.

It’s great to see a classic 8-bit computer reimagined in all kinds of new tribute form factors. The Spectrum was always beloved for its neat all-in-one design, and there are several modern remixes that riff on that theme. The fact that they can all be powered by a cheap single-board microcontroller is all the more astounding. Video after the break.

Continue reading “A Pico-Based ZX Spectrum Emulator”

Bringing The PIO To The FPGA

We’ve seen some pretty incredible hacks using the Raspberry Pi 2040. However, one of the most exciting bits of hardware onboard is the Programmable I/O (PIO). Not content with it just being a part of RP2040-based projects, [Lawrie Griffiths] has been porting the PIO to Verilog so anyone can enjoy it.

This particular implementation is based only on the spec that Raspberry Pi provides. For assembling PIO code, [Lawrie] uses Adafruit’s pioasm assembler they use for their MicroPython framework. There’s a simulator to test different programs, and the project targets the Blackice MX and the Ulx3s. A few example programs are included in the repo, such as outputting a pleasant guitar note over I2S and driving a chain of WS2812s.

The project is still incomplete but slowly making progress. It’s an incredible feat of reverse engineering. While the simulator can be used to debug programs, step through instructions, and inspect waveforms, the ultimate value of bringing the PIO to other systems is that now we can re-use the code. Things like the can2040, an implementation of the CAN bus protocol using the PIO. Or even a PIO-based USB host.