;; via http://nerdralph.blogspot.com/2013/12/writing-avr-assembler-code-with-arduino.html /* Optimized AVR305 half-duplex serial uart implementation * timing for 81N, 115.2kbps @8Mhz = 69.4 cycles/bit * and @16Mhz = 138.9 cycles/bit * @author: Ralph Doncaster * @version: $Id$ */ #include ; correct for avr/io.h 0x20 port offset for io instructions #define UART_Port (PORTB-0x20) #define UART_Tx 0 #define bitcnt r18 #define delayArg 19 .global TxTimedByte ; transmit byte in r24 with bit delay in r22 - 15 instructions ; calling code must set Tx line to idle state (high) or 1st byte may be lost ; i.e. PORTB |= (1<