Serial Interrupt Programming in 8051 Microcontroller
Serial Interrupt Programming in 8051 Microcontroller Baud Rate calculation: To meet the standard baud rates generally crystal with 11.0592 MHz is used. As we know, 8051 divides crystal frequency by 12 to get a machine cycle frequency of 921.6 kHz. The internal UART block of 8051 divides this machine cycle frequency by 32, which gives the frequency of 28800 Hz which is used by UART. To achieve a baud rate of 9600, again 28800 Hz frequency should be divided by 3. This is achieved by using Timer1 in mode-2 (auto-reload mode) by putting 253 in TH1 (8-bit reg.) So 28800 Hz will get divided by 3 as the timer will overflow after every 3 cycles. we can achieve different baud rates by putting the division factor in the TH1 register. Division factor to achieve different baud rates Baud Rate TH1 (Hex) 9600 FD 4800 FA 2400 F4 1200 E8 SCON: Serial Control Register Serial control register SCON is used to set serial communication operation modes. Also, it is used to control transmi...