why should I use a 'strange' crystal frequency ?
Submitted By: Erik Malund FAQ Last Modified: 11/08/06
- If you bring the Keil baudrate calculator http://www.keil.com/c51/baudrate.asp up you will see that with a traditional '51 the highest standard baudrate you can achieve within an error of 5% using a 12MHz crystal is 2400 baud. 5% is even too generous since it assumes that 'the other end' is 'on the mark', I do not like to be more than 1% off.
Now, if you, instead choose the most popular crystal for a '51, 11.0592MHz you can get up to 28.800 baud changing the SMOD bit get you up to 57.600 baud with zero error. For faster derivatives, you will often see 22.1184MHz used. Both frequencies are very popular and easy to obtain.
Now, if you use a derivative with a timer 2, things get better, with 12 MHz crystal, you can get up to 28.800 baud with an insignificant error. But again, let us see what happens with 11.0592MHz using timer 2: WOW, now you can achieve 115.200 with zero error.
One, sometimes overlooked fact is that crystal selection is very important for UART based ISP. The ISP software FlashMagic, FLIP, or other will try to achieve the best possible baudrate and, if you use e.g. a 12MHz crystal, you will get some awfully slow programming cycles.
Erik
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.