Skip to content
Software UART transmitter for AVR µCs which don't include an USART peripheral
C
Branch: master
Clone or download
MarcelMG optimized code, local copy of volatile tx_shift_reg
see closed Issue "Making the code shorter... #1" for details
Latest commit 98c892a Jul 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE.txt initial upload Oct 9, 2018
README.md initial upload Oct 9, 2018
main.c optimized code, local copy of volatile tx_shift_reg Jul 1, 2019

README.md

Software ("bit-bang") UART Transmitter ( 8 data bits, 1 stop bit, no parity ) for Attiny24A this can easily be ported to other AVR8 µC's or might even work without changes on many of them

the Baud rate is calculated as follows: BAUD = F_CPU / ( TIMER0_PRESCALER * (OCR0A + 1) so we can modify the prescaler and/or the OCR0A value to achieve a certain baud rate.

In this example I am using the internal 8MHz oscillator as clock source, so F_CPU=8000000 and a baud rate of 9600.

The program can be compiled with avr-gcc and the avr-libc libraries.

You can’t perform that action at this time.