We often take our "software serial" libraries lightly, and don't investigate what's going on under the hood - until they fail us, at least. Would you like to learn how to harness the power of interrupt-driven bitbanging? [Jim Mack] Teaches us how to fly our protocol implementation Using LTC protocol as springboard.
LTC (linear/[Longitudinal] TimeCode) is a widely used and beautifully crafted protocol that flies under our radar, and it is one that hackers can learn a lot from. It is used for synchronization of audio/video devices during media production and playback. The LTC's signal is almost digital but not quite: it does not need a clock, and has no polarity. Additionally, it mimics an audio signal really well, you can decode it at any playback speed, and many other benefits and quirks. [Jim] framework. However, you need to maintain time, and [Jim]The article shows us how to keep them right while not causing inconvenience to our primary tasks.
Using interrupts means that your main loop does other things, effectively letting you run a variety of tasks in the background. [Jim] An LTC protocol implements the transmitter using interrupts turned off at a defined frequency, performing LTC data processing in the main loop, and time-critical GPIO wiggling from inside the interrupt handler code. He explains the code structure and nuances along the way, and finally, gives us the source code of a highly capable and configurable LTC transmitter project for study and reuse. Be it RF transmitter bitbanging, IR remote signal reception, UART emulation, or any other protocol your MCU lacks in peripherals, this is where you learn how to make it work.
In [Jim]'s previous article, He has put these principles into practice again using an ATMega, explaining the fundamentals of accuracy and precision. In the next writing in this series, he wants to build an LTC decoder that teaches us even more about using interrupts properly for time-sensitive tasks. We can't wait!
0 Comments