Docsity

Quiz Solutions for ECE 383 - Microcomputers, Fall 2010, Quiz 4 - Prof. Qi Hao, Quizzes of Electrical and Electronics Engineering

Partial preview of the text

Download Quiz Solutions for ECE 383 - Microcomputers, Fall 2010, Quiz 4 - Prof. Qi Hao and more Quizzes Electrical and Electronics Engineering in PDF only on Docsity!

ECE 383 - Microcomputers

Fall 2010 – Quiz 4 Solutions

Instructions:

  1. Please write your name and student number in the upper right hand corner of the back of this sheet.
  2. When you are finished answering the questions, fold the paper in half lengthwise with this side of the page to the inside of the fold.

Problems:

  1. What is the frequency range of PWM signals generated by the Drag12plus board (20M Hz main clock)? Frequencymin = 20x10^6 /27+9+16=32^ | 20/4000 = 0.005Hz Frequencymax = 10MHz
  2. What are the frequency and duty cycle of the following PWM signals?

(1) MOVB #$55, PWMPRCLK

MOVB #100, PWMSCLA

MOVB #75, PWMSCLB

MOVB #100, PWMPER

MOVB #50, PWMDTY

Scaling = 32 x (2x75) x 100 Frequency = 50 Hz D = 50 %

(2) MOVB #$64, PWMPRCLK

MOVB #50, PWMSCLA

MOVB #75, PWMSCLB

MOVB #100, PWMPER

MOVB #50, PWMDTY

Scaling = 16 x (2x50) x 100 Frequency = 150 Hz D = 50 %

  1. Finish the following code to generate waveforms at 20 Hz and 0.2 Hz with50% high duty cycle

(1) MOVB # $40 , PWMPRCLK

MOVB # 250 , PWMSCLB

MOVB # 150 , PWMPER

MOVB # 75 , PWMDTY

BSET PWMPOL, # %

BSET PWMCLK, # %

BSET PWME, # %

(2) MOVB # $04 , PWMPRCLK

MOVB # 250 , PWMSCLA

MOVW # 15000 , PWMPER

MOVW # 7500 , PWMDTY

BSET PWMCTL, # %

BSET PWMPOL, # %

BSET PWMCLK, # %

BSET PWME, # %

  1. Finish the following code that can provide an interrupt service when pushbutton2 is pressed

ORG $ MOVW # $3300 , $3E4C BRA * CLI

ORG $ SEI BRCLR PIFH, # %00000100 , ISR_DONE INCA ISR_DONE: BSET PIFH, # % CLI RTI