why the crystal oscillator frequency in 8051 is chosen as 11.0592 Mhz
This has to do with the
arrangement used to generate baud rate frequency. There is only an 8 bit
timer/counter (T1) available for generating the baud rate clock. It is
used in mode 2 (auto reload). To get good computational speed, the
crystal has to have a high frequency. The propagation delays of the
datapaths allow around 12 MHz. If we try to divide the crystal frequency
directly, then to get the lowest baud rate of 300, we would need a
divisor of 12*10^6/300 = 40000. It would have not been possible with an 8
bit counter. Therefore the crystal frequency is first divided by 12 and
then by 32 before giving it to the counter. Now the counter could
manage baud rates as low as 12*10^6/256/12/32 = 122. But if we use a
round figure frequency of 12 MHz for the crystal, then the division
factors turn out to be fractional. For 300 baud we need a divisor of
104.1. Choosing the nearest integer 104 does not matter much here but
the situation is much worse for high baud rates. For 9600 baud, we need a
divisor of 3.22. Choosing the nearest integer of 3 would introduce a
very large error (7.3%). For 4800 baud, the division factor would be
6.51. The error by choosing divisor of 6 would be 17%. If we choose
crystal frequency of 11.0592 MHz, then the clock given to counter is
11.0592*10^6/12/32 = 28.8 KHz. Now the division factors for 9600 baud
and 4800 baud are 3 and 6 respectively. So we have precise frequencies.
Comments
Post a Comment