Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: MaiGoL7 on December 20, 2012, 09:25:37 AM

Title: ATmega8 USART
Post by: MaiGoL7 on December 20, 2012, 09:25:37 AM
Hi buddies.
I want to ask how can be "created" a new TXD because I need two TX and the first one is working. I wanted to switch to an ATmega128 but my request was denied, so I'm stuck at this point, how to create a new TXD.
Also the frame must be something like this:
0|byte|1 when all the frame is 1 that would mean that the buffer is empty.
And when that frame is sent, another ATmega8 must receive that value.
Title: Re: ATmega8 USART
Post by: jwatte on December 20, 2012, 11:32:47 AM
If the communication is from Atmega to Atmega, I suggest you use the I2C bus or the I2C bus instead of the UART bus.
How to use I2C (called "two-wire interface" or "TWI" in the Atmega data sheet) and SPI is described pretty well in the data sheet for the Atmega microprocessors.
Title: Re: ATmega8 USART
Post by: waltr on December 20, 2012, 10:35:03 PM
Do a web search for
"bit banging"
'Software serial"
"software UART"
To learn how this can be done.

The basic idea here is to control the logic level of one output pin with software. The pin is set to a high or low with precise timing to send a stream of data bits serially.