Skip to main content
Back to projects
complete 2012 hardware

AX.25 Packet Modem

A software-defined AX.25 packet radio modem built entirely on Arduino with PWM audio output and ADC decoding.

In late 2012 I built a 1200 baud AFSK packet modem (AX.25) on an Arduino, doing as much as possible in software so that the external parts list stayed short.

Why build a TNC?

Commercial terminal node controllers are expensive, and the classic designs from the 80s and 90s are getting harder to find. An AVR has enough headroom to demodulate 1200 baud packet in software, which puts a working TNC in the range of $30 of parts. The emulator project scratches the same itch: understanding a thing by building it.

Design

Everything that could be done in software was:

  • Hardware PWM generates the output waveforms by direct digital synthesis, so there is no DAC
  • A low-pass filter turns that PWM into clean audio tones
  • The ADC samples receive audio at 8kHz for software decoding
  • External SPI SRAM (512kbit 23LC512) provides the packet buffer

The decoder is adapted from the BeRTOS AX.25 stack, pulled out to run standalone without the rest of the operating system. That gave me a working correlator to build on rather than a blank page.

How AFSK works

AX.25 at 1200 baud uses two tones: 1200 Hz for a mark (binary 1) and 2200 Hz for a space (binary 0). Generating them is straightforward. Detecting them is not, because the signal has already been through a radio’s audio stages by the time you see it. The correlator compares incoming samples against reference waveforms, which holds up far better under noise and distortion than counting zero crossings.

(I ran into the same problem again years later with the Bell 103 modem in the emulator project. Phone line or radio, the demodulation problem is the same shape.)

Software

The source is on GitHub, built with Atmel Studio rather than the Arduino IDE for better control over modules and memory. It was originally aimed at APRS and grew into a generic TNC with APRS capabilities. Other amateur operators have starred and forked it since.

Integration with Raspberry Pi

As described in my Raspberry Pi APRS article, the intended pairing was always this TNC with a Pi: the Arduino handles the radio and the timing, the Pi handles networking and the APRS-IS connection.

See also