Microprocessor Microcontroller RESIT 2021 MG
Microprocessor Microcontroller RESIT 2021 MG
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 answer
o Respect all symbols tags for technical diagrams
CORRECTION
Section A: (25 marks)
MODULE I: 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
Question 1 2 3 4 5 6 7 8 9 10
Answer F T F T F F T F T F
3. What is the file extension that is loaded in a microcontroller for executing any
instruction?
A. .doc
B. .c
C. .txt
D. .hex
4. What is the most appropriate criterion for choosing the right microcontroller of our
choice?
A. Speed
B. Availability
C. ease with the product
Page 2 / 9
D. all of the mentioned
Answer
Microcontrollers: PIC16F877A, PIC16F84A, Atmel
Microprocessor: intel 8085, intel 8086
5. Give the functions of the TRISB in a PIC16F84A microcontroller (1mk)
Answer
This is where the pin configuration of PORTB takes place. Its is used to decide which pin
you use as an input pin or s an output pin.
Section B: (45 marks)
Question One (12 marks)
a. From the microcontroller give two differences betweem Harvard Architecture
Page 3 / 9
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. Draw the circuit of PULL-UP resistor. Explain the functionning until the pulse signal
(logic) is send. (1.5 marks + 1.5 marks = 3 marks)
Drawing of the PULL-UP circuit
Functionning : at the resting state, the output is supply at Vcc then the logic is « 1 ».
when pressing on the push button, the output is directly toggle to logic « 0 », due to the
fact the we have connexion with the ground and the dropping voltage due to the
resistance.
d. From figure 1 below ;
e.1 Give the function of each terminals of the memory (1x4 =4marks)
Figure 1
Figure 2
Page 4 / 9
e.2 Explain clearly how each memory is located. (1 mark)
e.3 If a size used by a cell is 32K, what is the size for the memory of figure 2 ! (1 mark)
e.4 Describe a particular procedure that can be used to extend the size of this memory in such
a way that the memory shall be 5 times the actual one. (1 mark)
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 3
and Figure 4 show the appearance of a processor and a single RAM memory with the pins.
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!
c) Draw the diagram that describe the arrangement of the microprocessor and these RAM
memories. (4.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
Page 5 / 9
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)
f) What can be the behavior of the memory if an additional data (from address pins)
arrived! (1.5 marks)
If we an additional data (from address pins) arrived, the memory can’t be able to store it.
Data will be rejected.
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! (1.5 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.
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 220
RB7
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 6 / 9
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
Page 9 / 9