Discussion in "8051 Discussion Forum" started by    Maherbaloch    Oct 2, 2010.
Fri Dec 17 2010, 05:38 pm
wid da same crystal:(
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


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:54 pm
haha sorry i thought dat both r same
Fri Dec 17 2010, 05:57 pm
there is a lot of difference in both
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
Fri Dec 17 2010, 06:00 pm
but then burner will not work if u do this
and then many things go wrong
Fri Dec 17 2010, 06:01 pm
w8ng 4 2rrow wil be bst
Sat Dec 18 2010, 07:35 pm
stil same output
Sat Dec 18 2010, 08:03 pm
sorry sorry wrking
i 4geted 2 change da baudrate frm da terminal
Sat Dec 18 2010, 09:29 pm
good
now do ur previous job as u want to do

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

scaneraNom
Sat May 04 2024, 02:21 am
gtaletrzua
Fri May 03 2024, 10:55 am
Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am