0% found this document useful (0 votes)
0 views

Quiz3Sec1Keys (2)

.

Uploaded by

durugul03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Quiz3Sec1Keys (2)

.

Uploaded by

durugul03
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EEE212 Microprocessors Fall 2022

Quiz 3 – Section 1 Duration: 25 Minutes


Use of calculators and cellular phones NOT allowed during the exam.
Use comments and only use the space below (one instruction per cell).

1. (70 pts) Write an Atmel AT89S52 main program that will generate a binary waveform at
P1.0 with frequency f = 2 kHz and duty cycle = 60%. Use timer 0 in Mode 2. Assume clock
frequency CF = 12 MHz and use a polling system (do not use interrupts)

Period=500 microsec
ON Time=500*0.6=300 microsec=2 x 150 microsec
OFF time = 200 microsec

Modd,#
t
MAIN: MOV TMOD,#02h
SETB TR0
BACK: JNB TF0,$
SETB P1.0
CLR TF0
MOV TH0,#106
JNB TF0,$
CLR TF0
MOV TH0,#56
JNB TF0,$
CLR P1.0
MOV TH0,#106
CLR TF0
SJMP BACK

END
2. (30 pts) Assume CF = 12 MHz , SCON configured in Mode 3 with TH1 set to 246 and
SMOD=0. What is the transmission time (back to back) of 100 characters using the serial
port? Show your calculations clearly.

Serial Clock Transmisson Rate=12 * 10^6 /(12*32*(256-246)) bits/sec

Bit Transmission Time= 320 microsec

Transmission Time for 100 characters = 100 characters x 11 bit


transmissions/character x 320 microsec = 352 ms

You might also like