Arduino based CTCSS encoder

Several years ago I've owned a Kenwood TR751E and I've always regretted that I've sold this rig as looking back it was the best 2m multimode transceiver I've ever owned. So when I suddenly got the chance to buy, in very good condition, not only the TR751E but also the TR851E as a pair of transceivers I didn't think twice !

However one disadvantage of older generation transceivers is that they don't have any CTCSS system. Especially the encoder part is a lack as most repeaters use these tones nowadays.

So I've decided to 'quickly' put some lines of code in Arduino and make myself a CTCSS encoder. The handy and easy Arduino C-library however isn't particularly optimized when it comes to the utilization of the timer/counters of the ATMega328p that runs the Arduino. And to be honest not for a lot of other parts of the chips as well. But that's the trade of: easy code for less features. So after a handful of lines of Arduino code I've realized that it would be way more efficient to do this the bits and bytes way and use the MCU registers.

You can find the results freely to use in the project section here: