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

Microprocessor Microcontroller EXAM 2021 MG

This document contains information about a Bachelor of Engineering second semester examination for the 2020/2021 academic year in the department of Computer Engineering. The examination is for the course Microcontrollers and Microprocessor Technology and contains 3 sections: Section A contains 10 true/false questions worth 1.5 marks for a correct answer and -0.5 for an incorrect answer. It also contains 5 multiple choice questions worth 1 mark each. Section B contains 7 subquestions including drawing diagrams of memory arrangements and crystal clock circuits. It asks students to explain memory access and size calculations. Section C asks students to design an electronic circuit using a PIC16F84A microcontroller with a push button and lamp, and write assembly code
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

Microprocessor Microcontroller EXAM 2021 MG

This document contains information about a Bachelor of Engineering second semester examination for the 2020/2021 academic year in the department of Computer Engineering. The examination is for the course Microcontrollers and Microprocessor Technology and contains 3 sections: Section A contains 10 true/false questions worth 1.5 marks for a correct answer and -0.5 for an incorrect answer. It also contains 5 multiple choice questions worth 1 mark each. Section B contains 7 subquestions including drawing diagrams of memory arrangements and crystal clock circuits. It asks students to explain memory access and size calculations. Section C asks students to design an electronic circuit using a PIC16F84A microcontroller with a push button and lamp, and write assembly code
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Bachelor of Engineering

Second Semester Examinations


2020/2021 Academic year

Department: Computer Option: CSE/EME Level: 300/400


Engineering
Course code/ Title: CSE 302/ Microcontrollers and Credit value:
Microprocessor Technology
Duration: 13h00 – 16h00 Date: Monday 14/06/2021 Venue: Examination Hall
Course Instructor M. AZANGUE Brice Arthur / M. AKUPAN Rene

Read the instructions carefully before you start answering the questions.
Instructions
o Answer all questions
o You are free to start by any section.
o This paper is divided in to two sections section A and section B
o Orderly presents your answers
o Respect all symbols tags for technical diagrams

CORRECTION
Section A: (25 marks)
MODULE 1: TRUE or FALSE ( 10 marks)

Draw a table and answer by TRUE and FALSE


Instruction: 1.5 marks for correct answer and - 0.5 mark for wrong answer and

0 mark if no answer.

Questio 1 2 3 4 5 6 7 8 9 10
n
Answer

1. The way microprocessor compute data is the same for microcontroller.


2. The connection between the microprocessor and the microcontroller is the bus.
3. The control bus is used to provide information to the processor and interfaces while the
data bus is used to link elements in the CPU.
4. Under the program memory, we have the addresses and the instructions.
5. The data flowing through the bus in the computer into a packet of data and it is sent
randomly.
Page 1 / 11
6. The synchronization of the action performed by the processor is possible thank to the
counter.
7. Under a memory, the validation/selection of a cell is possible thanks to a special
terminal hold by a cell.
8. The PWM signal at the output of the converter is actually filtering by the high pass
filter so that the signal is well recover.
9. The circuit that provides external clock to the microcontroller has two capacitor that
the function is to maintain constant functioning of the circuit.

Answer

Question 1 2 3 4 5 6 7 8 9 10
Anwers T T F T F T T F T F

MODULE II: Multiple choices (5 marks)


1. How many clock pulses are confined by each machine cycle of Peripheral-Interface
Controllers?
A. 4
B. 8
C. 12
D. 16
2. Which flags are more likely to get affected in status registers by Arithmetic and
Logical Unit (ALU) of PIC 16fxx on the basis of instructions execution?
A. Carry (C) Flags
B. Zero (Z) Flags
C. Digit Carry (DC) Flags
D. All of the above
3. How many RP0 status bits are required for the selection of two register banks?
A. 1
B. 2
C. 8
D. 16 
4. The RP0 status register bit has the potential to determine the effective address
of______
A. Direct Addressing Mode
B. Indirect Addressing Mode
C. Immediate Addressing Mode
D. Indcexed Addressing Mode
5. Which status bits exhibit carry from lower 4 bits during 8-bit addition and are
especially beneficial for BCD addition?
A. Carry bit (C)
B. Digits Carry bit (DC)
C. Both a & b

Page 2 / 11
D. None of the above

MODULE III: Short Questions (10 marks)


1. What is the value of the accumulator register after the execution of the instructions? (2
mks)
MOV A, #95
ADD A, #120
Answer
AC  215
2. What is the use of SFR in 8085 processor? (2 mks)

Answer
A special purpose register is one that has a specific control or data handling task to carry out.
There are a number of special purpose registers within the CPU. The diagram above shows
that the CPU contains a number of registers in order to process data and to follow program
instructions. Some specialist ones include

3. List some three SFRs involved in 8085 processor. (3 mks)


Answer

- Accumulator
- Stack pointer
- Flag registers

4. With example instruction, explain some three addressing modes supported by 8085
processor? (3 mks)
Answer
Immediate addressing mode
In this mode, the 8/16-bit data is specified in the instruction itself as one of its operands. For
example MVI E, ABH means ABH is copied into register A.
Register addressing mode
In this mode, the data is copied from one register to another. For example, MOV A, B: means
data in register B is copied to register A.
Direct addressing mode
In this mode, the data is directly copied from the given address to the register. For example
LDA 3000H: means the data at address 3000H is copied to register A.
Indirect addressing mode

Page 3 / 11
In this mode, the data is transferred from one register to another by using the address pointed
by the register. For example, MOV A, M: means data is transferred from the memory address
pointed by the register pair HL to the register A.

Section B: (45 marks)


Question One (12 marks)
a. From the microcontroller give two differences betweem Harvard Architecture

and von- Neumann architecture ! (1 marks x4=4 marks)


b.

Harvard Architecture Von- Neumann architecture

RISC CISC
RAM+ROM in single memory RAM and ROM in different memory
Low speed High speed
Less complexity More complexity

c. The microcontroller is driven by crystal clock circuit. Draw this circuit. How this
circuit process to synchronize the data. (3 marks)
Drawing of the circuit

To synchronize the data, the clock circuit provide the input frequency of the processor.
This frquency in divided into 4 inner the processor so that each important area shall be
have his own frequency to work. (3 marks)
d. Let consider the memory location i figure 1.

Page 4 / 11
Figure 1
d.1 How many bits of address is used for this memory! (1.5 marks)
The memory use 4 addresses bits.
d.2 find the number of possibility that this memory can used for the register. (1.5 marks)
The number of possibility is 24 = 16 possibilities.
d.3 Give the set of bits of data lines if the input address is 1001. (2 marks)
The set of data lines for address 1001: 00001001

Question Two (13 marks)

Mapping memory of the microprocessor

We consider a single processor that drive the RAM memories with 16 adresses and 8 bits for
data lines for access at each memory cell. Each memory cell has a capacity of 64K. Figure 2
and Figure 3 show the appearance of a processor and a single RAM memory with the pins.

Figure 2 Figure 3

a) How many RAM memory cell is used! (1 mark)

Page 5 / 11
The number of RAM memory cell is equal to the number of data pins driven by
microprocessor. We will used 8 RAM memory cells.

b) How the data are transferred (from address pins) until reach to the memory!

The data in transferred in packet of data. (1 mark)

c) Draw the diagram that describe the arrangement of the microprocessor and these
RAM memories. (5 marks)

Diagram of the arrangement

d) Explain exactly how the RAM memory cell is accessed. (1.5 marks)

Each cell memory is accessed using a data pins (from 0000000 to 11111111) of the
microprocessor. These pins are driven when new packet of data is present at the level of
address pins. And when memory cell is already used, a particular counter check other bit to
know whether memory cell is being used of not.

The whole memory is full when each RAM memory cell is used (from 0000000 to
11111111).

e) What is the total size (CT) of the Whole memory! (1.5 marks)

Total size: CT = 64K x 8 = 512K CT = 512 K

f) What can be the behavior of the memory if an additional data (from address pins)
arrived! (2 marks)

If we an additional data (from address pins) arrived, the memory can’t be able to store it.
Data will be rejected.

Page 6 / 11
g) We consider that a set of each data that will be stored in a RAM memory cell used the
half (1/2) of the memory cell. How many sets of data is possible to full the whole
memory! (2 marks)

The size of memory cell is 64K then the half is 32K. then to full a single cell we need 2
packets of data. Since we have 8 memories cells, then we will have 16 packets of data to
completely full the whole memory.

Question Three (10 marks)


a) Using PIC16F84A, design an electronic circuit with push button switch SW connected to
RA0 and a lamp connected to RB0
b) From the design in (a) write an assembly code to flash the lamp on for one second and off
for one second when the switch is pressed. The lamp should stay off when ever the switch
is open. You are obliged to add comments to your code

Answer
SW

X1 U1
16
OSC1/CLKIN RA0
17 R5
15 18 10k
OSC2/CLKOUT RA1
1
CRYSTAL (4MHz) RA2
4 2
MCLR RA3
C2 C1 RA4/T0CKI
3
22pF 1pF
6
RB0/INT
7
RB1
8
RB2
9
RB3
10
RB4
RB5
11 R9
12 220
RB6
13
RB7
PIC16F84A

R8 D8
LED-BIRG
10k

RESET PIC (MASTER CLEAR)

;;===>>Blink led using the delay function


STATUS EQU 03h
TRISB EQU 86h
PORTB EQU 06h
TRISA EQU 85h
PORTA EQU 05h
COUNT1 EQU 08h
COUNT2 EQU 09h

BSF STATUS,5
;;MOVLW 00H
;;MOVWF TRISB
CLRF TRISB ;; SET PORTB FOR OUTPUTS
Page 7 / 11
MOVLW 0X01
MOVWF TRISA ; SET ra0 AS IBPUT
BCF STATUS,5

CLRF PORTA
LOOP CLRF PORTB
MAIN BTFSS PORTA,0
GOTO LOOP

MOVLW 0X01
MOVWF PORTB

CALL ROUTINE
CLRF PORTB
CALL ROUTINE
GOTO MAIN

ROUTINE
; =======DELAY CODE
LOOP3 DECFSZ COUNT1,1
GOTO LOOP3
LOOP4 DECFSZ COUNT2,1
GOTO LOOP4
RETURN
END
Question Four (10 marks)
Consider the electronic circuit below designed on the PIC16F84A. The circuit is a seven-segment
display circuit which displays the numbers 0,1,2,3,4,5,6,7,8,9and repeat the sequence continuously

X1 U1
16 17
OSC1/CLKIN RA0
15 18
OSC2/CLKOUT RA1
1
RA2
4 2
CRYSTAL (4MHz) MCLR RA3
RA4/T0CKI
3
COMMON CATHODE 7 SEGMENT
C2 C1 R1
22pF 1pF 6
RB0/INT
7
RB1 220
8
RB2
9
R2
RB3
10
RB4 220
11
RB5
12
R3
RB6
13
RB7 220
PIC16F84A
R4
220
R5
R8
220
10k R6
RESET PIC (MASTER CLEAR) 220
R7
220

a) Explain the relevance of R1, R2, R3, R4 R5, R6, R7 and RESET PIC

Page 8 / 11
b) Develop an assembly language program that will implement this sequence of counts. The PIC is
operating at a frequency of 4MHz. The MCLR Button resets the PIC controller. You are obliged
to add comments to your code
c) Based on your program written in (a), calculate the total time of execution of the program

Answer

a) R1, R2, R3, R4 R5, R6, R7 limits the voltage the goes to power the LEDs in the 7-sement
and RESET PIC is used to reset all operation in the PIC
b) ======
;Project: Counting on 7-segment display
List P = 16F84
#include <p16F84.inc>
__CONFIG 1Bh ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC

COUNT1 EQU 09H


COUNT2 EQU 08H
TRISB EQU 86H
PORTB EQU 06H
BSF STATUS,RP0
CLRF TRISB
CLRW
BCF STATUS,RP0
CLRF PORTB
START MOVLW 0x3F ;0
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x06 ;1
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x5B ;2
MOVWF PORTB
Page 9 / 11
CALL DELAY
CALL DELAY
MOVLW 0x4F ;3
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x66 ;4
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x6D ;5
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x7D ;6
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x07 ;7
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x7F ;8
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW 0x6F ;9
MOVWF PORTB
CALL DELAY
CALL DELAY
GOTO START
Page 10 / 11
;;;===================DELAY FUNCTION=================
DELAY
LOOP1 DECFSZ COUNT1,1
GOTO LOOP1
DECFSZ COUNT2,1
GOTO LOOP1
RETURN
END
c) ======
Frequency = 4MHz
Total instructions = 72
Total number of cycles = 4 * 72
Total time of execution = ( 4*72)/(4MHz) = 72us

Page 11 / 11

You might also like