Half duplex UART from single AVR pin
Smaller microcontrollers like Attiny84 microcontrollers don’t have UART interfaces, and you may not need them in many cases. But if you want a USART option, you will need to use software USART library or write your own routines. You can find many great software USART libraries for that purpose. As a rule, you will have to use two pins to establish communication. But if you are tight on I/Os, you can cheat a little and make it work from a single pin. Ralph has been experimenting with the simple but intelligent circuit, which allows performing half duplex UART communications with other systems. The whole trick lies in a small schematic made of diode, transistor and resistor. Diode is only for making one way TX signal path from MCU to other device. The resistor is only for limiting base current. All is left a transistor which works as a key. We need to remember that when the serial line is inactive, it stays in the high state. So when microcontroller transmits data, TX on the right keeps transistor open. Thus if…