PDA

View Full Version : usart help



snk_naveen
05-24-2009, 11:37 AM
hi friends,
do i need to add external crystal to my atmega8 for using usart , i have a 16 mhz crystal can i add that ??

vikas
05-24-2009, 12:42 PM
No you dont the built in clock can also handle it. Just set the right fuses.

suhasm
05-24-2009, 03:43 PM
You dont need a xtal for USART. It will work just fine with the internal crystal oscillator also. But there might be errors in the transmission as the internal oscillator is not very reliable.

You will have to set the proper fuses if you want to use an xtal. You can use the 16mhz crystal. However , it is recommended that you use one of the 'magic number' crystals like 14.7456Mhz whose frequency is perfectly scalable to the commonly used baud rates for more accuracy.

avinash_g
05-25-2009, 08:26 AM
Hello,

Here are some links to help u

http://extremeelectronics.co.in/avr-tutorials/rs232-communication-the-basics/

http://extremeelectronics.co.in/avr-tutorials/rs232-communication-the-level-conversion/

http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers/

http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers-reading-and-writing-data/

Hope they help u. :D

snk_naveen
05-25-2009, 04:54 PM
hi avinash

after studying your tutorial i built the rs232 cable and performed the loop back test. when i type in the terminal ,whatever i type is only shown !! does that mean it works ??
and when i connect it the MCU and performed the Sample program to use AVR USART i get some silly characters which i cannot understand .

suhasm
05-25-2009, 07:32 PM
after studying your tutorial i built the rs232 cable and performed the loop back test. when i type in the terminal ,whatever i type is only shown !! does that mean it works ??

that is correct. That is what is supposed to happen.