Home
Telegraph

Telegraph is a collection of C-based routines I've found useful in dealing with non-Linux-based microcontrollers like PIC and AVR.. It includes a Hamming(8,4) encoder and decoder, a Fletctcher 16-bit checksum generator, a simple signal debouncer and edge detector useful for dealing with general purpose input/output (GPIO) pins, and some stuff ported from Diminuto that wasn't (as most of Diminuto is) specific to Linux-based development.

Hamming codes are a class of error correcting codes or ECCs invented by Richard Hamming in 1947 when he was at Bell Labs. He published his paper describing them in the Bell System Technical Journal in 1950 [R. W. Hamming, "Error Detecting and Error Correcting Codes", BSTJ, XXIX.2, April 1950]. Hamming codes are widely used today in telecommunications and in semiconductor memory systems.

Hamming(8,4) encodes a four-bit data nibble into an eight-bit symbol byte with four parity bits in such a way that single-bit errors in a symbol can be detected and corrected, and double-bit errors can be detected. In this way, moderately noisy communication channels or storage mediums can be used at the expense of some overhead. Hamming(8,4) is an example of a SECDED code ("single error correction, double error detection") which uses a Hamming(7,4) code (that's the SEC part) with an additional fourth parity bit (the DED part).

Fletcher-16 is a dirt simple sixteen bit checksum algorithm used in TCP headers [J. Zweig, C. Partridge, "TCP Alternate Checksum Options", RFC 1146, March 1990] and in other embedded applications.

The distribution contains a unit test suite.

Telegraph can be found on GitHub here.

 

Presentation: Implications of Memory Consistency (or Lack of It) Models for Java, C++, and C Developers (more)

Seminar Review: Jack Ganssle, Better Firmware Faster, 2006 (more)

Article: Vaster than Empires and More Slow: The Dimensions of Scalability (more)

Article: In Praise of do-while (false) (more)

Book Review: Joel Spolsky, Best Software Writing I, Apress, 2005 (more)

Presentation: Robert Austin, Measuring and Managing Performance in Organizations, Dorset House, 1996 (more)

Book Review: Joel Spolsky, Joel on Software, Apress, 2004 (more)

Presentation: James Surowiecki, The Wisdom of Crowds, Doubleday, 2004 (more)

Travelogue: China Journal: Dancing with a Sleeping Giant (more)

Unless otherwise specified, all contents Copyright © 1995-2015 by the Digital Aggregates Corporation, Colorado, USA.
Such copyrighted content is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.5 License.