You are on page 1of 4

MICRO-PROCESSOR & INTERFACE

LAB
[Document subtitle]

Lab report no. 01


Class BCE-5(A)
Name ADNAN JAVED
Roll no. 01-132172-031
Submission Date: 23/09/2019
Submitted to Ma’am Tooba
LAB NO. 01

Objective:
 To understand how the interrupts came.
 To understand how we generate the interrupts in IC’s.
 To understand how much important are the interrupts

Introduction:
Apparatus:
 Microcontroller Trainer
 PIC16F877
Tools:
 Proteus
 Micro C
 Programmer
TASK 1:
Coding :
sbit rowa at RB0_bit; while(c3==0){
sbit rowb at RB1_bit; PORTD=0x03; }}
sbit rowc at RB2_bit; rowa=1;
sbit rowd at RB3_bit; rowb=0;
sbit c1 at RB4_bit; rowc=1;
sbit c2 at RB5_bit; rowd=1; // test row B
sbit c3 at RB6_bit; if (c1==0) {
void main(){ delay_ms(300);
TRISB=0b11110000; while(c1==0) {
PORTB=0x00000000; PORTD=0x04;}}
TRISD=0; if (c2==0) {
OPTION_REG =0x7F; delay_ms(300);
while(1) { while(c2==0){
rowa=0; PORTD=0x05;} }
rowb=1; if (c3==0){
rowc=1; delay_ms(300);
rowd=1; // test row A while(c3==0){
if (c1==0) { PORTD=0x06; } }
delay_ms(300); rowa=1;
while(c1==0){ rowb=1;
PORTD=0x01; } } rowc=0;
if (c2==0) { rowd=1; // test row C
delay_ms(300); if (c1==0) {
while(c2==0){ delay_ms(300);
PORTD=0x02; }} while(c1==0){
if (c3==0) { PORTD=0x07; } }
delay_ms(300); if (c2==0) {
delay_ms(300); delay_ms(300);
while(c2==0){ while(c1==0) {
PORTD=0x08; } } PORTD=0x0A; } }
if (c3==0) { if (c2==0) {
delay_ms(300); delay_ms(300);
while(c3==0){ while(c2==0) {
PORTD=0x09;} } PORTD=0x00; } }
rowa=1; if (c3==0){
rowb=1; delay_ms(300);
rowc=1; while(c3==0) {
rowd=0; // test row D PORTD=0x0B; } } } }
if (c1==0) {

PROTEUS SIMULATION:

Conclusion :
In this lab , I easily understand about the basics of the microprocessor and microcontroller. I understand
how they work and how we can program the ics of MICR. We also work on the Chip PIC16F877. All he
programming is done on the Micro-C software. All perform all the tasks successfully without any
ambuguity.

You might also like