A hardware uart is almost always better unless you need some non-standard
protocol. You use software uarts when you run out of hardware, or don't
want to spend the money on an external uart chip.
Software uarts are not too bad if the baud rates you are dealing with are
low enough.
I have a mega8 project with 3 uarts. One hardware and two software. But
the software uarts are only running at 4800 baud max.
Need a Int0/1 pin and a timer for each uart. There are ways to
oversample and use only a single timer for multiple channels, but now you
are using quite a bit of software overhead.
As David pointed out a very good case for interrupts.
There is a thread about this with some links to applications notes on
AVRfreaks. But as we know the freaks site is down due to some juvenile
hacking. We'll see how long it takes them to plug the holes in the php
forum code.
-carl
At 09:09 PM 7/31/2005, you wrote:
>Im working in a project with atemega8 and atemega32, for this work is
>necessary 3 serial ports, and I cant loose any data, but what happen if
>two or more ports have incoming data at the same time?, what can I do?,
>other question is what is the adventage for use usart hardware or usart
>software?.
>
>Sounds like a good case for using interrupts.
>Software uarts require a fair bit of software overhead to run, but if you
>need three uarts, you're pretty much stuck with that.
>
>OTOH, I seem to remember a data sheet for an AVR with four hardware uarts.Message
RE: [AVR-Chat] Two or more serial ports
2005-08-01 by Henry Carl Ott
Attachments
- No local attachments were found for this message.