Академический Документы
Профессиональный Документы
Культура Документы
0b) [2] Can you name 2 people form technical support services (stockroom)?
Introduction 1a) [2] What is the difference between a micro controller and a micro processor?
1b) [2] What is the difference between a common computer system and an embedded computer system?
ECE 372 1st Midterm HC11 CPU / Microcontroller 2 a) [3] List all functional components of our microcontroller (built into microcontroller) 2 b) [5] explain what they are used for 2 c) [2] give suggestion what can be attached to the unit or what other unit is connected to it (do not list more than two) Functional Unit Purpose Connected to
ECE 372 1st Midterm 3 a) [2] Our microcontroller has a register based design. List all registers by completing the list below (do not list configuration registers = $10xx) 3 b) [3] List the purpose of the register (do not list more than 2 purposes) Register Purpose - Condition Code Register (general answer, more details in next question)
- Program Counter
ECE 372 1st Midterm 3 c) [5] The Condition Code Register is based on 8 bits. All bits indicate certain conditions of the microcontroller. List the function of up to 5 of these bits. Bit Function ZERO
3 d) [2] The system you constructed in the laboratory indicates that the program counter points to $4000. Is there a problem with that?
ECE 372 1st Midterm UofA system hardware 4 a) [3] Our microcontroller can be operated in expanded mode but also in bootstrap mode and single chip mode. What is the difference between them?
4 b) The normal operation mode of our micro controller involves a multiplexed bus. A bus is composed of data, address and control lines. - [2] What is a multiplexed bus?
- [1] How many data lines and how many address lines do we have?
- [1] How many physical pins are associated with the address and data lines?
ECE 372 1st Midterm 4 c) [4] In the laboratory you built a reset circuit. Why do we not simply use a pushbutton to ground reset if we want to restart the microcontroller (or what is the purpose of those 2 integrated circuits you wired to the reset pin)?
ECE 372 1st Midterm Basic Instruction Cycle You want to execute ABA. 5a) [1] What does this instruction do?
5b) [4] Which part of this process would you consider to be Fetch, Decode and Execute? Think of what happens inside the microcontroller and associate the steps to fetch, decode and execute. Fetch
Decode
Execute?
ECE 372 1st Midterm Data Formats 6) You read a faulty EEPROM and found that sometimes you read a binary value of 0011 0011 and sometimes a value of 1001 0011 at the same memory location. What does this data represent in 6 a) [1] Hexadecimal
6 b) [3] HC11 instruction. You need to state MNEMONIC instruction name Addressing mode Function of the instruction (speculate if you do not know)
ECE 372 1st Midterm Assembly Programming 7 a) [10] This is a very short program. Please fill in the gaps. Shaded area=nothing can be filled in.
Label MAIN
Instruction LDX
LOOP
INX
Operand EEPROM Address #$ $8000 $8001 $8002 $8003 #$ $8004 $8005 $8006 LOOP $8007 $8008 $8009 $FFFE $FFFE MAIN $FFFF
7 b) [2] What is happening in register X in this program? If the program counter points to $8009 what is the contents of register X?
ECE 372 1st Midterm 7c) [10] For each E clock cycle (actually each half cycle) show what values will be on the pins (AD0..7,A8..15) when the previous program is executed. Assume that the reset switch was pressed and show what happens from that point on forward. Fill in comments where appropriate. Only go through the loop one time.
$FF80
$FFFF
$80CE
$8001
$80..
10
ECE 372 1st Midterm Appendix Page0 ASCII table Assembly Commands for X register
11
` grave
a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ DEL delete
quote
# $ % &
$06 $07 $08 $09 $0A $0B $0C $0D $0E $0F $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $1A $1B $1C $1D $1E $1F
apost.
( ) * + , comma
- dash . period
/ 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
58
MOTOROLA
8
DIR ACCA INH 0001 1 SBA CBA CMP SBC COM LSR SUBD AND BIT ROR ASR ASL ROL DEC STA EOR ADC ORA ADD INC TST JMP CLR 4 5 6 7 XGDX 8 9 BSR LDS STS A B STOP C D CPX JSR PAGE 4 LDX STX E F LDD STD LDA STA ADDD BHI BLS BCC BCS BNE BEQ BVC BVS BPL BMI BGE BLT BGT BLE 2 3 SWI WAI MUL PSHX RTI ABX RTS PULX PSHB PSHA TXS DES PULB PULA BRN INS BRA TSX NEG SUB 2 3 4 5 6 7 8 9 A B C D 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 E REL INH ACCA ACCB IND,X EXT IMM DIR IND,X EXT IMM DIR IND,X ACCB EXT 1111 F 0 1 2 3 4 5 6 7 8 9 A B C D E F BSET BCLR TAB TBA DAA ABA BSET BCLR 1 IND,X
Page 1
INH
MSB
0000
LSB
0000
TEST
0001
NOP
0010
IDIV
BRSET
0011
EDIV
BRCLR
0100
LSRD
0101
ASLD
0110
TAP
0111
TPA
1000
INX
PAGE 2
1001
DEX
1010
CLV
PAGE 3
1011
SEV
1100
CLC
1101
SEC
1110
CLI
BRSET
1111
SEI
BRCLR
MOTOROLA
ABX
Operation: Description:
ABX
Adds the 8-bit unsigned contents of accumulator B to the contents of index register X (IX) considering the possible carry out of the low-order byte of the index register X; places the result in index register X (IX). Accumulator B is not changed. There is no equivalent instruction to add accumulator A to an index register.
M68HC11 Rev. 6 MOTOROLA Instruction Set Details For More Information On This Product, Go to: www.freescale.com
BLO
Operation: Description:
BLO
If the BLO instruction is executed immediately after execution of any of the instructions, CBA, CMP(A, B, or D), CP(X or Y), SBA, SUB(A, B, or D), the branch will occur if and only if the unsigned binary number represented by ACCX was less than the unsigned binary number represented by M. Generally not useful after INC/DEC, LD/ST, TST/CLR/COM because these instructions do not affect the C bit in the CCR. See BRA instruction for further details of the execution of the branch.
BLS
Operation: Description:
BLS
If the BLS instruction is executed immediately after execution of any of the instructions, CBA, CMP(A, B, or D), CP(X or Y), SBA, SUB(A, B, or D), the branch will occur if and only if the unsigned binary number represented by ACCX was less than or equal to the unsigned binary number represented by M. Generally not useful after INC/DEC, LD/ST, TST/CLR/COM because these instructions do not affect the C bit in the CCR. See BRA instruction for further details of the execution of the branch.
CPX
Operation: Description:
CPX
Compares the contents of index register X with a 16-bit value at the address specified and sets the condition codes accordingly. The compare is accomplished internally by doing a 16-bit subtract of (M : M + 1) from index register X without modifying either index register X or (M : M + 1).
N R15 Set if MSB of result is set; cleared otherwise. Z R15 R14 R13 R12 R11 R10 R9 R8 R7 R6 R5 R4 R3 R2 R1 R0 Set if result is $0000; cleared otherwise. V IX15 M15 R15 + IX15 M15 R15 Set if a twos complement overflow resulted from the operation; cleared otherwise. C IX15 M15 + M15 R15 + R15 IX15 Set if the absolute value of the contents of memory is larger than the absolute value of the index register; cleared otherwise. Source Form: CPX (opr)
Reference Manual 534 Instruction Set Details For More Information On This Product, Go to: www.freescale.com
DEX
Operation: Description:
DEX
Only the Z bit is set or cleared according to the result of this operation. Condition Codes and Boolean Formulae:
Z R15 R14 R13 R12 R11 R10 R9 R8 R7 R6 R5 R4 R3 R2 R1 R0 Set if result is $0000; cleared otherwise. Source Form: DEX
Reference Manual 540 Instruction Set Details For More Information On This Product, Go to: www.freescale.com
INX
Operation: Description:
INX
Only the Z bit is set or cleared according to the result of this operation. Condition Codes and Boolean Formulae:
Z R15 R14 R13 R12 R11 R10 R9 R8 R7 R6 R5 R4 R3 R2 R1 R0 Set if result is $0000; cleared otherwise. Source Form: INX
M68HC11 Rev. 6 MOTOROLA Instruction Set Details For More Information On This Product, Go to: www.freescale.com
LDX
Operation: Description:
LDX
Loads the most significant byte of index register X from the byte of memory at the address specified by the program, and loads the least significant byte of index register X from the next byte of memory at one plus the address specified by the program.
V 0
N R15 Set if MSB of result is set; cleared otherwise. Z R15 R14 R13 R12 R11 R10 R9 R8 R7 R6 R5 R4 R3 R2 R1 R0 Set if result is $0000; cleared otherwise. V 0 Cleared Source Form: LDX (opr)
Reference Manual 554 Instruction Set Details For More Information On This Product, Go to: www.freescale.com
PULX
Operation: Description:
PULX
Index register X is pulled from the stack (high-order byte first) beginning at the address contained in the stack pointer plus one. The stack pointer is incremented by two in total. Push instructions are commonly used to save the contents of one or more CPU registers at the start of a subroutine. Just before returning from the subroutine, corresponding pull instructions are used to restore the saved CPU registers so the subroutine will appear not to have affected these registers.
Reference Manual 568 Instruction Set Details For More Information On This Product, Go to: www.freescale.com
PSHX
Operation: Description:
PSHX
The contents of index register X are pushed onto the stack (low-order byte first) at the address contained in the stack pointer. The stack pointer is then decremented by two. Push instructions are commonly used to save the contents of one or more CPU registers at the start of a subroutine. Just before returning from the subroutine, corresponding pull instructions are used to restore the saved CPU registers so the subroutine will appear not to have affected these registers.
M68HC11 Rev. 6 MOTOROLA Instruction Set Details For More Information On This Product, Go to: www.freescale.com
STX
Operation: Description:
STX
Stores the most significant byte of index register X in memory at the address specified by the program, and stores the least significant byte of index register X at the next location in memory, at one plus the address specified by the program.
V 0
N IX15 Set if MSB of result is set; cleared otherwise. Z IX15 IX14 IX13 IX12 IX11 IX10 IX9 IX8 IX7 IX6 IX5 IX4 IX3 IX2 IX1 IX0 Set if result is $0000; cleared otherwise. V 0 Cleared Source Form: STX (opr)
M68HC11 Rev. 6 MOTOROLA Instruction Set Details For More Information On This Product, Go to: www.freescale.com