Microcontroller 8051 with PC interface
Fri Dec 17 2010, 05:51 pm
oho my GOD
u do simulation and coding according to 11.0592 Mhz crystal
review ur Proteus file
go to properties where u load hex file there u mention that crystal is 11.0592 Mhz
it was ur mistakes
you can't get proper 9600 bauds with acceptable error on a 8051 at 12MHz.
What you set now is 12000000/12/32/7=4464 Baud, which has an error of over 6% to 4800 Bauds. The acceptable error is around 3%. You could possibly get a good 9600Baud on a 8052, using Timer2 for baudrate generation.
See the datasheets/tutorials/etc. and also Keil's baudrate calculator at:
http://www.keil.com/c51/baudrate.asp
see this table
i suggest u to use 11.0592MHZ crystal u not get it from market then use 22.1184MHZ
u do simulation and coding according to 11.0592 Mhz crystal
review ur Proteus file
go to properties where u load hex file there u mention that crystal is 11.0592 Mhz
it was ur mistakes
you can't get proper 9600 bauds with acceptable error on a 8051 at 12MHz.
What you set now is 12000000/12/32/7=4464 Baud, which has an error of over 6% to 4800 Bauds. The acceptable error is around 3%. You could possibly get a good 9600Baud on a 8052, using Timer2 for baudrate generation.
See the datasheets/tutorials/etc. and also Keil's baudrate calculator at:
http://www.keil.com/c51/baudrate.asp
see this table
Use the following formula if SMOD = 1
TH1 = (256 - (XTAL_12000000 / (16 * 12 * baudrate)));
Use the following formula if SMOD = 0
TH1 = (256 - (XTAL_12000000 / (32 * 12 * baudrate)));
eg. 11059200/(32*12) = 28800 incase of 12MHZ it comes 62500
now 28800/9600 = 3
thus 256 - 3 = 253 decimal and 0XFD in hex as TH1 load count.
For above example clear SMOD bit
In the same way you can derive the chart for different baudrates at different crystal frequencies.
i suggest u to use 11.0592MHZ crystal u not get it from market then use 22.1184MHZ
[ Edited Fri Dec 17 2010, 05:58 pm ]
Fri Dec 17 2010, 05:57 pm
there is a lot of difference in both
specially in baud rate generation
specially in baud rate generation
Fri Dec 17 2010, 05:58 pm
2day market r closed
i will brng it 2morw
em thnkng 2 take out crystal of burner
i will brng it 2morw
em thnkng 2 take out crystal of burner
Fri Dec 17 2010, 06:00 pm
but then burner will not work if u do this
and then many things go wrong
and then many things go wrong
Powered by e107 Forum System