Society of Robots - Robot Forum
Software => Software => Topic started by: airman00 on August 23, 2008, 07:53:14 PM
-
I have a question on UART.
Why is UART limited to certain pins on the AVR?
Back in my PIC days ( like 3 months ago , lol ) I was able to achieve TTL serial communication on any pin . It seems that with the AVR UART is only on certain pins. Well serial is just a combination of 1 and 0 , so shouldn't serial be possible on any output pin?
Can someone clear this up for me ?
Thanks,
Eric
-
hardware UART vs software UART . . . the previous is more accurate, faster, and less computationally expensive.
the latter is called 'bit banging (http://en.wikipedia.org/wiki/Bit-banging)'
-
oh thanks for clearing that up
with hardware UART does this "run in the background" or something like that?
-
Someone correct me if I'm wrong here, but I believe the buffer does. But it's only like 1 byte, if I remember correctly.
-
is there some function in the AVRlib for bit-banging?
-
If you google around, you can find source code to do it. No built in function, however.
-
The Arduino environment has a bit bang send and recieve serial on any pin that I have used. It could be hacked to run under gcc.
Kirk
-
yep
http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/docs/html/index.html (http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/docs/html/index.html)
-
Actually now that I think about it, I seem to remember seeing AVRlib having a software UART.
-
Oh I forgot about AVR USB firmware only USB
http://www.obdev.at/products/avrusb/index.html
-
sorry bad link above
http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/docs/html/group__uartsw.html (http://www.mil.ufl.edu/~chrisarnold/components/microcontrollerBoard/AVR/avrlib/docs/html/group__uartsw.html)