Arduino pins can be used as UART using the library SoftwareSerial.h Is there any alternative for AVR?

I need more than one serial port on a ATmega328P, but i don't use arduino.

SoftwareSerial.h is tied to Arduino.h and Arduino pins. I do not use Arduino, i use avr-gcc with atmega328p and atmega8.

  • \$\begingroup\$ Sorry my english. \$\endgroup\$
    – Avelino
    May 24, 2015 at 0:02
  • \$\begingroup\$ Sorry, as much as I would like to understand the question, I can't. \$\endgroup\$ May 24, 2015 at 0:03
  • \$\begingroup\$ I need more than one serial port on a ATmega328P \$\endgroup\$
    – Avelino
    May 24, 2015 at 0:04
  • \$\begingroup\$ Arduino is AVR. Port it over. \$\endgroup\$
    – Matt Young
    May 24, 2015 at 0:04
  • \$\begingroup\$ @Avelino Transmit only, or receive only, or both? What baud rate? \$\endgroup\$ May 24, 2015 at 0:05

1 Answer 1


AVR274 describes a single-wire, half-duplex software UART.

AVR304 describes a half-duplex, interrupt-driven software UART, and AVR305 describes a polled alternative.

AVR307 describes implementing a half-duplex UART using a USI.

All code associated with each app note can be downloaded from Atmel's Microchip's website.

  • 1
    \$\begingroup\$ I would strongly recommend using the interupt driven software UART. The polled alternative frequently results in corruption, even when just using as simplex output. \$\endgroup\$
    – teambob
    May 24, 2015 at 6:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.