problem in uart communication!!!

General discussion on mikroC PRO for AVR.
Author
Message
twhoney
Posts: 12
Joined: 14 Apr 2009 14:48

Re: problem in uart communication!!!

#16 Post by twhoney » 06 Mar 2012 08:27

n_vikranth wrote:I followed UART library and done every thing as mentioned in library file including connections...
i using ATMEGA16A and 8Mhz crystal, but i cant communicate with pc....
wat ever i entered in the screen and transmitted it should be back,but the reply is always something like EEEEEEEEEEE....... what is my mistake?
how to communicate with pc using uart(rx and tx).

and when ever i build a program it shows Generated baud rate is 9615 bps (error = 0.16 percent)

how to generate accurate 9600 bps , help me........
The only Way to generate the correct Baudrate is to use a "Baudrate friendly" Chrystal.
Use 3,6864 MHz to run your CPU and you get an error of 0,0 % up to 230KBaud.

When you have ever read the Datasheet of your CPU you should know this.

Check the USART Section in the Datasheets. There are Tables of Settings and error Rates for the.

best regards from Germany

Sulya
Posts: 1
Joined: 24 Mar 2013 21:52

Re: problem in uart communication!!!

#17 Post by Sulya » 24 Mar 2013 21:59

I know it's an old thread, but I just want to help those who encounter same problem in the future.
Since MikroC compiler produces different code for different clock speeds to maintain right timing you can always change project's clock speed instead of replacing crystal.

In my case I was able to solve the issue by changing clock speed (in project properties) to 4.3 instead of 4 MHz, what resulted right timing for UART

one25
Posts: 30
Joined: 23 Jul 2012 10:04

Re: problem in uart communication!!!

#18 Post by one25 » 29 Oct 2014 12:09

Hi all,

I am using crystal with 11.0592MHz frequency and this is the same I set under "edit project" menu.

I am getting the message
116 1509 Generated baud rate is 19231 bps (error = 0.16 percent)

Why ?

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: problem in uart communication!!!

#19 Post by filip » 29 Oct 2014 15:37

Hi,

Which MCU are you using ?

Regards,
Filip.

one25
Posts: 30
Joined: 23 Jul 2012 10:04

Re: problem in uart communication!!!

#20 Post by one25 » 03 Nov 2014 16:47

Hi, Filip,
I am using ATmega32.

Is interesting but I am no longer getting the message. Anyway, the communication worked and works well.

Thank you very much.

Post Reply

Return to “mikroC PRO for AVR General”