{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Quiz3_sample2 - Fall Semester BILKENT UNIVERSITY Department...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
12-07-2009 Fall Semester BILKENT UNIVERSITY Department of Electrical and Electronics Engineering EEE212 Microprocessors QUIZ-3 open book, closed notes, calculators allowed Duration: 30 minutes Surname:_______________________________________ Name:_________________________________________ ID-Number:_____________________________________ Signature:_______________________________________ Q1 (40 points) Q2 (60 points) TOTAL
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Q1 (40 pts) Write the code initializing the necessary SFRs to perform serial communication using 8051 with a) a baud rate of 4800 for XTAL=3.6864 MHz. b) a baud rate of 11520 for XTAL=11.0592 MHz. In part b, SMOD bit should be set to 1 . In order to get partial credits, show your calculations clearly. a) baud rate=3.6864/12/32/X where X=256-TH1. X=9600/4800=2 ->TH1=-2=0FEH Code: MOV IE,#90H MOV SCON,#50H MOV TMOD,#20H MOV TH1,# -2; (0FEH) SETB TR1 b) SMOD flag=1 baud rate=11.0592x10 6 /12/16/X where X=256-TH1. X can be found to be 5 ->TH1=-5=0FBH Code: MOV IE,#90H MOV SCON,#50H MOV TMOD,#20H ORL PCON,#80H ;set the SMOD flag MOV TH1,# -5; (0FBH) SETB TR1
Background image of page 2
Q2 (60 pts) Write a program that reads Port0 and transmits the read data to Port1 when either
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}