ATtiny84 Software UART

So back a few years ago since before I moved over working on the ESP family, I was an Atmel junkie. One of the thing’s that came in real handy was working with Software UART and the ATTiny84. It was a real great learning experience and I got really really burned with the DIV8 fuse being enabled on chip’s by default. I wanted to post my work here because I’m sure someone else may need it for the AT84 or 4313 2313 etc etc. Now the code below can be improved but the main thing to really take home is the caluclating the baud sleep while in the function. #define SleepRX9600 104 //= (1/ 9600) #define SleepRX4800 180 //= (1/ 4800) #define sleepTransmitString4800 208 #define sleepTransmitString9600 104   Now one thing to take home is if you want to transfer at 9600 baud over a second just take 1 / baud to get your uS sleep time. After you get it rocking you adjust the numbers to match the clock cycles of your added code. Sending data is almost mirrored logic. In this case I was working with a GPS, Once the string is received you can parse it just as if it is any other string in C.  

Leave a comment

Your email address will not be published. Required fields are marked *