[aprssig] APRS spec 101

Ben Jackson ben at ben.com
Wed Jul 16 17:20:43 EDT 2008


In case it's useful, here's my implementation (AVR, but should be portable)
from the HF beacon I worked on for a while.  These are just the key lines
abstracted out of the code:

	uint16_t ax25fcsval;

	/* flag(s) not part of fcs */

	/* reset */
	x25fcsval = 0xffff;

	/* all data bits in transmit (lsb first) order. */
	/* does not include "stuffing" bits */
	foreach bit {
		xor = ax25fcsval & 1;
		ax25fcsval = (ax25fcsval >> 1);
		if (bit ^ xor) ax25fcsval ^= 0x8408;
	}

	/* xmit (lsb first) */
	uint16_t fcs = ax25fcsval ^ 0xffff;	/* latch fcs here */
	ax25byte(fcs & 0xff);
	ax25byte(fcs >> 8);

	/* flag not part of fcs */

-- 
Ben Jackson AD7GD
<ben at ben.com>
http://www.ben.com/




More information about the aprssig mailing list