Baud Rate is the data transmission rate that determines the symbols per second for serial communication. The microcontroller is connected with COM port of the PC for the purpose of serial communication. So, in order to allow data transfer between PC and microcontroller without any error, we must make sure that the baud rate of the microcontroller (8051) matches the baud rate of the PC's COM port.
2. The 8051 has external clock of frequency 11.0592 MHz, which gets divided by 12 to get machine cycle frequency is 921.6 kHz.
3. The 8051 microcontroller serial communication UART circuitry divides the machine cycle frequency of 921.6 kHz by 32, before it is used by Timer 1 to set the baud rate. Therefore, 921.6 kHz divided by 32 gives out 28,800 Hz.
4. When Timer 1 is used to set the baud rate it must be programmed in mode 2, that is 8-bit auto reload. To get baud rates compatible with PC, we must load TH1 with values: -3, -6, -12, -24. These values are fixed to find out suitable baud rate compatible with PC's COM port. PC baud rates values are set by the vendors and are fixed. Some of the baud rates values supported by Pentium IBM PC are as 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200. So, one has to generate 8051 microcontroller baud rate accordingly.
For example:
Lets XTAL=11.0592 MHz is divided by 12 = 921.6 kHz and then, 921.6 kHz/32 = 28,800 Hz is the frequency provided by UART to Timer 1 to set baud rates.
Steps to calculate Baud Rate:
1. The 8051 microcontroller transfers and receives data serially at many different baud rates. The baud rate in the 8051 is programmable and can be set through Timer 1 or by changing the external crystal oscillator.2. The 8051 has external clock of frequency 11.0592 MHz, which gets divided by 12 to get machine cycle frequency is 921.6 kHz.
3. The 8051 microcontroller serial communication UART circuitry divides the machine cycle frequency of 921.6 kHz by 32, before it is used by Timer 1 to set the baud rate. Therefore, 921.6 kHz divided by 32 gives out 28,800 Hz.
4. When Timer 1 is used to set the baud rate it must be programmed in mode 2, that is 8-bit auto reload. To get baud rates compatible with PC, we must load TH1 with values: -3, -6, -12, -24. These values are fixed to find out suitable baud rate compatible with PC's COM port. PC baud rates values are set by the vendors and are fixed. Some of the baud rates values supported by Pentium IBM PC are as 110, 150, 300, 600, 1200, 2400, 4800, 9600, 19200. So, one has to generate 8051 microcontroller baud rate accordingly.
For example:
Lets XTAL=11.0592 MHz is divided by 12 = 921.6 kHz and then, 921.6 kHz/32 = 28,800 Hz is the frequency provided by UART to Timer 1 to set baud rates.
- 28,800/3= 9600 where, -3 is loaded with TH1
- 28,800/6= 2400 where, -12 is loaded with TH1
28,800/6= 2400 where, -12 is loaded with TH1 this sentence is wrong
ReplyDelete28,800/6 = 4800 and -12 is loaded with TH1
28800/3=9600 but y ur loading TH1 with -3
ReplyDeleteWhy u divide by 3 to 288000
ReplyDelete