Docsity

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

Toggle sidebar
bg1
ECE 383 - Microcomputers
Fall 2010 โ€“ Quiz 3
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 are the 7-segment LED patterns (Hexadecimal) of the following symbols?
a. โ€œ9โ€ $6F
b. โ€œHโ€ $76
c. โ€œEโ€ $79
d. โ€œLโ€ $38
e. โ€œPโ€ $73
f. โ€œ!โ€ $86
2. Finish the following code for a 10s delay (assuming 24MHZ MCLK).
DELAY_10s: LDX #2000
DELAY_1: LDY #40000
DBNE Y, *
DBNE X, DELAY_1
3. Finish the following code that can display data on the discrete LED.
ORG $1000
DATA DC.B $F0
ORG $2000
MOVB #$FF , DDRB
MOVB #%00000010 , DDRJ
MOVB DATA , PORTB
BCLR PORTJ , #%00000010
JSR DELAY_10s
BSET PORTJ , #%00000010
4. Finish the following code that can test whether Key_10 (index) is pressed.
MOVB #$0F , DDRA
BSET PORTA, #%00001111
BCLR PORTA, #%00000100
BRSET PORTA, #%11110000 , *
LDAA PORTA
CMPA #%10111011
BNE KEY_10_NOT_PRESSED

Partial preview of the text

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

ECE 383 - Microcomputers

Fall 2010 โ€“ Quiz 3

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 are the 7-segment LED patterns (Hexadecimal) of the following symbols? a. โ€œ9โ€ $6F b. โ€œHโ€ $ c. โ€œEโ€ $ d. โ€œLโ€ $ e. โ€œPโ€ $ f. โ€œ!โ€ $
  2. Finish the following code for a 10s delay (assuming 24MHZ MCLK).

DELAY_10s: LDX # DELAY_1: LDY # DBNE Y, * DBNE X, DELAY_

  1. Finish the following code that can display data on the discrete LED.

ORG $ DATA DC.B $F

ORG $

MOVB #$FF , DDRB

MOVB #%00000010 , DDRJ

MOVB DATA , PORTB

BCLR PORTJ , #%

JSR DELAY_10s BSET PORTJ , #%

  1. Finish the following code that can test whether Key_10 (index) is pressed.

MOVB #$0F , DDRA

BSET PORTA, #%

BCLR PORTA, #%

BRSET PORTA, # %11110000 , *

LDAA PORTA

CMPA #%

BNE KEY_10_NOT_PRESSED