An FPGA cassette interface turns UART traffic into recordable audio

FPGA, cassette, UART

This is the read-only HTML version. For the full Visual Space experience, open the app.

FPGA, cassette recorder — Imag

FPGA, cassette recorder — Imag

Source: Cassette interface for FPGAs on Hackaday.io · zpekic

Retrocomputing, storage

zpekic’s cassette interface lets a terminal send bytes to tape and receive them back through a UART. The design uses two audio tones and an onboard ADC rather than FFT-based decoding; the creator reports reliable operation at 300 and 600 bps, with 1200 bps requiring careful adjustment.

🎉 1

A cassette recorder can store serial data without knowing anything about bytes. In Cassette interface for FPGAs, shared on Hackaday.io by zpekic, an FPGA translates outgoing UART traffic into audio tones and turns playback back into serial data. The project’s record and playback logs, both dated November 2, 2020, describe a deliberately simple arrangement: a terminal on a PC, an FPGA board and an ordinary tape recorder.

The useful boundary is the UART. Software sends characters or a file as serial traffic; the FPGA handles the audio representation. There’s no need for the terminal to understand tape, although the person operating the recorder still has to find the right position and press the buttons.

Two tones carry the serial stream

The hardware list centers on a Mercury FPGA board and its baseboard, which provides 3.5 mm audio connections. A USB-to-UART PMOD adapter connects the PC, while audio cables connect the FPGA’s output to the recorder’s microphone input and the recorder’s speaker output to the FPGA’s input. The signal is mono, even though stereo cables are listed.

In the recording log, zpekic describes binary frequency-shift keying: one frequency represents a one, and another represents a zero. The output logic is small enough to grasp at a glance—it selects one of two frequency signals according to the incoming serial level, then sends the result to both audio channels.

Those outputs are square waves, not carefully synthesized sine waves. The recording path cannot preserve all their harmonics, so the waveform changes on its way to tape. The design relies on recovering the distinguishing frequencies, rather than preserving the precise shape of the original signal. That’s an important simplification: the stored audio needs to retain the information, not look identical to the FPGA output.

Playback trades signal processing for fast sampling

The playback log describes using the board’s ADC with a 25 MHz clock and a sampling rate of about 0.75 MHz. zpekic calls both excessive for the task, but convenient to obtain with simple clock dividers.

The receiver does not use an FFT or the Goertzel algorithm to identify the tones. Instead, the creator describes using the FPGA and fast ADC with simpler detection tricks. The visible excerpt stops during the ADC setup, so it doesn’t explain the complete detector. The linked tape UART VHDL file is the place to investigate that implementation further.

The reported practical speeds are 300 and 600 bps. The creator says 1200 bps needs a high-quality recorder and tape, plus careful volume and tone adjustment. It’s a useful distinction between a selectable rate and one that tolerates an everyday recording setup.

A serial connection still needs a storage routine

Board switches select the baud rate and serial framing, and the terminal must use matching settings. Recording means pressing Record and sending data; playback means rewinding, pressing Play and watching recovered bytes arrive in the terminal.

Text makes an easy first test because errors are visible. zpekic also suggests a HEX format or similar text representation for binary data, noting the usefulness of basic checksum checking. Playback should stop when the UART activity ends, otherwise material beyond the intended recording can produce unwanted bytes.

That leaves a clear lesson for anyone adapting the design: recovering bits is only part of making usable storage. Tape positions, record boundaries and integrity checks still need attention. A sensible next test would therefore be a checksum-checked file round trip at 300 or 600 bps—not merely readable characters on screen—before pushing the recording chain toward 1200 bps.

Source: Cassette interface for FPGAs

Hardware

3 Followers

A workshop for electronics and physical computing. Share circuits, boards, tools and prototypes; work through measurement and debugging, compare components, and document the choices that turn an idea into working hardware.

Visual Space is built for projects like this—where creators collaborate, organize goals, and grow communities around real work.