You are on page 1of 3

SRI LANKA INSTITUE OF INFORMATION TECHNOLOGY

B.Sc. Eng. Department of Electronic & Computer Engineering


EC 2131 – Micro Computers
Laboratory 03

▪ Create a report answering the following questions. The simulation will be checked during
the lab time/Viva
▪ Rename all the simulation files and c codes in the following format
Eg: ENXXXXXX_lab3__
▪ Rename the submission file as ENXXXXXX_Lab3
▪ Make sure to read the necessary data sheets to answer the questions given.
▪ After answering the questions, before attempting the next questions indicated the datasheet
page numbers which the answers are found
Eg: Question 1 section 1 Answer: The shoes had been there for as long as anyone
could remember. It was difficult for anyone to come up with a date they had first
appeared. It had seemed they'd always been there and yet they seemed so out of
place. Why nobody had removed them was a question that had been asked time and
again, but while they all thought it, nobody had ever found the energy to do it
(Referred from PIC164877a data sheet page 15)

Pre Lab

Part 1
Introduction to Interrupts and Polling

1. What is an Interrupt in microcontrollers?


2. What is polling in microcontrollers?
3. What are the advantages of interrupts compared to polling?
4. What is the disadvantageous of interrupts compared to polling?
5. What is an ISR?

1
6. Briefly explain the types of interrupts and their advantages and disadvantages.
7. What are vectored interrupts?
8. What are non-vectored interrupts?
9. What is a program counter?
10. What is a program memory?
11. Explain what program stack is and how push and pop instructions work the program stack.

Part 2
Interrupts in PIC16f877a

1. What is an Interrupt vector?


2. Explain the interrupt handling mechanism of PIC16F877a using the Program counter, Program
memory, and Program stack. Make sure to use diagrams to provide a clearer explanation
3. What are the 15 sources of interrupts in PIC16F877A? Briefly explain each of them
4. What are the registers required to configure an interrupt in PIC16F877a?
5. Briefly explain the following registers. Make sure to sketch the register diagrams given in the
datasheet and briefly explain the operation of individual bits of the following registers.
a. INTCON
b. OPTION_REG
c. PIE1
d. PIR1
e. PIE2
f. PIR2
6. Explain the importance of GIE and PEIE bits by using the interrupt logic diagram (Figure 14-
10) provided in the datasheet

2
Lab Task

Part 4
Proteus Simulation

Requirements
• PIC16F877A
• A red and a green LED
• Push-button

Make a program in C and Assembly to carry out the following task.


• A green LED should blink with a delay of 1000ms under normal circumstances.
• However, if the push button is pressed green LED should blink with a delay of
500ms for 10s while the red LED is on. The second SHOULD BE CARRIED OUT
WITH AN ISR.

Part 5
Viva Demonstration

Viva will be held to check the knowledge of the students. Depending on the situation of the country
the viva will be made online or on campus. In the case of a campus viva, students should implement
task 4 in the laboratory and demonstrate it to the instructors.

You might also like