Building a standalone, software TNC


This design is based around the excellent ATMEGA328 based TNC and LibAPRS library as designed by Mark Qvist at unsigned.io. It's the first, and one of the major building blocks for a series of APRS projects.


completed TNC board

How is started

After spending some time playing with Direwolf and Xastir I decided it sure would be great to have a cheap, easy to integrate TNC that could be used in projects without a full computer. After some fits and starts with TCM3105 IC and attempting to make a discrete hardware TNC, I settled on a software modem designed by people much more knowledgeable with ADCs, DACs, and DSP than me.

One of my problems was the RAM requirements for all the peripherals I want to include in my APRS handheld transceiver project. The graphics library for the OLEDs takes up nearly half the arduino RAM by itself. This isn't even getting into certain timing critical aspects, such as detecting and encoding the in-phase change that must occur between the 1200hz and 2200hz tones of the AX.25 packet protocol.

Mark's Micromodem lets me offload all the timing critical encoding/decoding of packets to another microcontroller. I can now go on to experiment and write untold miles of spaghetti code where all I need concern myself with is serial communication between the modem and another MCU.


Board designs

kicad pcb design

This is mostly just a redesign of Mark's Micromodem, with a few features removed that I don't need and all in a small castellated board that made it easy to test and debug some of my earliest SMD solder work. Programming is done over the ISP header, and can be loaded with Mark's KISS/SimpleSerial firmware written in C, or an Arduino compatible program using the LibAPRS library- most useful in a simpler project where the ATMEGA can be the only MCU without running into timing and memory issues.

I actually got the first one up and running by etching a double sided board myself and using stripped wire-wrap kynar wire to make the vias. It actually worked! Although it was very tedious to make and I would not try to do it again when the boards I got from jlcpcb were $5USD for 10 boards. It is the first time I have soldered a tqfp chip, so that was worth the practice.

doublesided homebrew board

Pinout of the final board is shown below. It exposes all the SPI, Serial, and I2C pins, 3 GPIO and the RX/TX led pins (leds can be soldered on the board or use external leds when the modem is mounted to another PCB).

pinout of nanomodem

Testing

Modem was tested by hooking an audio cable up and talking to the Direwolf software modem on the PC. It works great! Mark's resistor-ladder DAC makes a good sinewave and direwolf picks it up no problem. It also picks up the input audio well and parses that into source, destination, and message; fed back out over 9600baud serial.

tnc output waveform

I like the space savings surface mount brings not just in part size, but only having pads on one side of the board opens up room for other traces underneath. Not that a through-hole version isn't handy too; with the standard square pin headers it could be installed in a project with wire wrapping, perf-board, or just a bunch of dupont jumpers.

So that's one more building block for my APRS network. Further testing and project integration coming soon.


Design files

Mark Qvist's firmware and libAprs library is located here: https://github.com/markqvist
My board design files are here, in Kicad 5.0 and gerber format: https://gitlab.com/motivemachine/aprs-nanomodem