9600 Baud Rate Not Work in Easy8051B

General discussion on mikroPascal PRO for 8051.
Post Reply
Author
Message
arponcedeleon
Posts: 8
Joined: 27 May 2010 00:30

9600 Baud Rate Not Work in Easy8051B

#1 Post by arponcedeleon » 17 Aug 2010 03:41

Hi,

I have the development board Easy8051B, and the compiler mikroPascal for 8051, and I want use UART and the problem is here:
With the example of mikroPascal -> this work with UART1_Init(4800); and I have perfect result is ok. When I change the baud rate to 9600 really dont work, I read bad bytes (note: if I change the value baud in my source code I change the baud rate in my RS232Terminal).

The microcontroller is a AT89S8253
using the oscilator 10MHz
Default pin RS232 are RX=P3.0 and TX=P3.1

I use also the project example Software UART Library and dont work too.

thanks

Adrian

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: 9600 Baud Rate Not Work in Easy8051B

#2 Post by tihomir.losic » 17 Aug 2010 10:33

arponcedeleon wrote:The microcontroller is a AT89S8253
using the oscilator 10MHz
Default pin RS232 are RX=P3.0 and TX=P3.1
Hello,

you need to select following option in mikroPascal:
x2 - optional parameter for certain ATMEL MCU's that feature x2 mode, which speeds up the MCU by 2 (6 oscillator periods per instruction, instead of 12).
x2.PNG
x2.PNG (9.29 KiB) Viewed 4737 times
On following link, you can find out more about baud rate for ATMEL 8051 microcontrollers:
http://www.atmel.com/dyn/resources/prod ... oc4316.pdf
X2 bit is located in the CKCON register.
In X2 mode, FOSC=FXTAL. In standard mode, FOSC=FXTAL/2.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

arponcedeleon
Posts: 8
Joined: 27 May 2010 00:30

Re: 9600 Baud Rate Not Work in Easy8051B

#3 Post by arponcedeleon » 17 Aug 2010 15:30

Thanks,
Just now I go to test that mode,

If I use a 11.0592 MHz?

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: 9600 Baud Rate Not Work in Easy8051B

#4 Post by tihomir.losic » 17 Aug 2010 15:52

Hello,

please, try with 16MHz...

Best regards,

Losic Tihomir
mikroElektronika [Support team]

arponcedeleon
Posts: 8
Joined: 27 May 2010 00:30

Re: 9600 Baud Rate Not Work in Easy8051B

#5 Post by arponcedeleon » 18 Aug 2010 16:43

Thanks,

The change with Oscilator 10MHz and cheking the option x2 work perfectly, I can send and receibe byte on PORT COM RS232 9600Baud

But when I try with 11.0952MHz this option dont work,

I have a hardware made like a display 7segment (8 display) and need read array of bytes by serial port in 9600,8,N1 and It hardware have a MCU AT89C52 with external oscilator of 11.0952 MHz, for the moment I change the MCU by AT89S8253 all the pin are similar, I change this MCU why the 8051Flash Programmer dont have the AT89C52 and cant programing.

must be exist some way to compile my program with oscilator 11.0952MHz,

thanks you

Post Reply

Return to “mikroPascal PRO for 8051 General”