We regularly take our “SoftwareSerial” libraries as a right, and don’t examine what goes on underneath the hood — till they fail us, not less than. Would you wish to discover ways to harness the ability of interrupt-driven bitbanging? [Jim Mack] teaches us how to make our protocol implementations fly utilizing the LTC protocol as a springboard.
LTC (Linear/[Longitudinal] TimeCode) is a widely-used and beautifully-crafted protocol that tends to fly underneath our radar, and is one which hackers may be taught a lot from. It’s used for synchronization of audio/video units throughout media manufacturing and playback. LTC’s sign is sort of digital however not fairly: it doesn’t want a clock, and it has no polarity. Moreover, it mimics an audio sign very well, you’ll be able to decode it at any playback velocity, and lots of different advantages and quirks that [Jim] outlines. You do want to take care of the timings, although, and [Jim]’s article reveals us the right way to preserve them proper whereas not inconveniencing your main duties.
Utilizing interrupts signifies that your major loop will get to do different issues, successfully letting you run completely different sorts of duties within the background. [Jim] implements an LTC protocol transmitter utilizing interrupts fired off at an outlined frequency, doing LTC information processing in the principle loop, and the time-critical GPIO wiggling from contained in the interrupt handler code. He explains the code construction and the nuances alongside the way in which, and ultimately, even supplies us with supply code of a extremely succesful and configurable LTC transmitter venture for us to check and reuse. Be it RF transmitter bitbanging, IR distant sign reception, UART emulation, or some other protocols your MCU lacks peripherals for, that is the place you be taught to get it working.
In [Jim]’s previous article, he’s gone to nice lengths explaining the basics of precision and accuracy, then placing these theories into observe once more, utilizing an ATMega. Within the subsequent write-up of this sequence, he wish to create an LTC decoder, educating us much more about correctly utilizing interrupts for timing-sensitive duties. We are able to’t wait!