Docsity

Midterm Exam | Microprocessor Based Design | ECE 367, Exams of Microprocessors

Toggle sidebar
bg1
2003 University of Illinois at Chicago ECE 367 V. Goncharoff
Web code: Score:
Last name:
First name:
Signature:
ECE 367 - Microprocessor-Based Design
Midterm Examination (7 pages, 26 problems: 50 minutes, closed book and notes.)
No electronic devices other than a calculator are permitted.
IMPORTANT: Please be aware that academic dishonesty will result in
grade E for the course, and possibly dismissal from the University.
Looking at another exam paper, showing someone your exam paper,
violating the closed book/notes rule, or otherwise communicating exam
problem information to/from another student during the exam is
considered to be academically dishonest. Should you have any
questions about this policy or about any of the exam questions,
please step up to the front and ask the instructor for clarification.
1. What value is represented by the byte $3A when the code being used is
a) unsigned binary:
b) signed binary:
2. What value is represented by the byte $A3 when the code being used is
a) unsigned binary:
b) signed binary:
( )10
( )10
( )10
( )10
pf3
pf4
pf5

Partial preview of the text

Download Midterm Exam | Microprocessor Based Design | ECE 367 and more Exams Microprocessors in PDF only on Docsity!

Web code: Score:

Last name:

First name:

Signature:

ECE 367 - Microprocessor-Based Design Midterm Examination (7 pages, 26 problems: 50 minutes, closed book and notes.) No electronic devices other than a calculator are permitted.

IMPORTANT: Please be aware that academic dishonesty will result in grade E for the course, and possibly dismissal from the University. Looking at another exam paper, showing someone your exam paper, violating the closed book/notes rule, or otherwise communicating exam problem information to/from another student during the exam is considered to be academically dishonest. Should you have any questions about this policy or about any of the exam questions, please step up to the front and ask the instructor for clarification.

  1. What value is represented by the byte $3A when the code being used is

a) unsigned binary:

b) signed binary:

  1. What value is represented by the byte $A3 when the code being used is

a) unsigned binary:

b) signed binary:

  1. What are the values of C and V flags after these 68HC11 assembly language instruction are executed?

LDAA #$FF DECA

  1. Translate the following 68HC11 assembly language instructions into machine code (the first one is done for you):
  2. (Circle only one letter) Which of these 68HC11 instructions has the longest machine code?

a) INC 0,Y b) CMPB #$0A c) RTS d) RTI

  1. (Circle only one letter) Which of these 68HC11 instructions takes longest to execute?

a) INC 0,Y b) CMPB #$0A c) RTS d) RTI

  1. (Circle only one letter) Which of these 68HC11 instructions does not change the stack pointer register contents?

a) JMP Delay b) JSR Delay c) RTS d) RTI

C = , V =

LDAB 0,Y $18 $E6 $00_

BRA * ________________

ADDD #01 ________________

  1. What is the duty cycle of the waveform produced at PORTB by the endless loop below?

PORTB EQU $ LDX #$

Loop: LDAA #$FF (2) STAA PORTB,X (4) LDAA #$00 (2) STAA PORTB,X (4) NOP (2) NOP (2) NOP (2) BRA Loop (3)

  1. Given that the frequency of E clock is 2 MHz, what is the frequency of the PORTB waveform produced by the endless loop below? (The number of clock cycles per instruction are shown in parentheses.)

PORTB EQU $ LDX #$ CLRA

Loop: EORA #$FF (2) STAA PORTB,X (4) NOP (2) BRN Loop (3) EORA #$FF (2) STAA PORTB,X (4) NOP (2) BRN Loop (3) EORA #$FF (2) STAA PORTB,X (4) NOP (2) BRA Loop (3)

  1. Write code to clear flag OC2F:

Hz

  1. When writing interrupt-driven code to produce a PWM waveform at PA6 of the M68HC11E, what two TOC registers would you use for this purpose?

TOC__ , TOC__

  1. What prescaling factor and ∆TCNT value would you use when writing interrupt-driven code to execute exactly every 0.005 sec? (E = 2MHz) More than one correct answer may exist; write only one answer below:

Prescaling factor N = ___ , ∆TCNT = ____________

  1. With circuit below, what bit pattern should be sent to Port B to have the seven-segment common-anode LED to display digit "3"?
  2. In Problem 17 control signal PB0 is: (circle a or b)

a) active high b) active low

  1. In Problem 17 control signals {PB1-PB7} are: (circle a or b)

a) active high b) active low

MC68HC microcontroller (^) PB PB PB PB PB PB

a b c d e f g

common anode

a b c d

f e

g

PB

PB

Port B = $ __ __

  1. Draw a circuit showing a 9 volt relay (having 70mA "on" current) interfaced to PB0 of the 68HC11 microcontroller ( V DD = 5v). Label resistor value, power supply voltage value, and include a current snubber network.
  2. True or False: Pre-bytes are used to expand the 68HC11 instruction set while maintaining backward machine code compatibility.
  3. What page of 68HC11 memory is normally used for the stack?
  4. Write assembly language code that configures all bits of PORTC for input:
  5. From a programmer's point of view, what are two limitations on using the BRCLR instruction?

Page: ( ) (^10)

Circle one: True False

a)

b)