Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Continuous Assessment Cover Sheet

Faculty of Engineering

Module Details
Module Code EC 2481 Module Title INTRODUCTION TO CONTROLS & ROBOTICS
Program: Name:
Stream: (Civil/Electronics/Mechanical)

Assessment details

Title Microcontroller Circuits Group assignment YES / NO

If yes, Group No.

Lecturer/ Instructor Miss. Subashini de Silva Date of Performance 24/07/2020


Due date 20/07/2020 Date submitted 24/07/2020

Student statement and signature


By this declaration, I/we confirm my/our understanding and acceptance that the work reported in this report is my/our own wor k. I/we also
understand the consequences of engaging in plagiarism or copying others work without proper citation. Any material used in this work (whether
from published sources, the internet or elsewhere) have been fully acknowledged and referenced and are without fabrication or falsification of
data.
[Copying or plagiarism will result in a “0” mark for the continuous assessment and “F” for the module after an investigation on academic
misconduct;

All academic misconduct is considered seriously and defined as dishonest and in direct opposition to the values of a learning community.
Misconduct may result in penalties from failure to exclusion from the campus.
Further help and guidance on how to avoid academic misconduct can be obtained from your academic advisor/tutor]

By this declaration, I confirm my understanding and acceptance that-


• I have adhered to relevant ethical guidelines and procedures in the completion of the assignment.
• I have not allowed another student to have access to or copy from this work. This work has not been
submitted previously.
[The Institute may request an electronic copy of this work for submission to the Plagiarism detection facility (TURNITIN). You must make sure
that an electronic copy of your work is available in these circumstances]

Group Number: Signature


Student ID EN19381664 Full Name Wijerathna W.M.D.U
Student ID Full Name

Student ID Full Name

Student ID Full Name

Student ID Full Name

OFFICE USE ONLY


Specific comments about the work (including overall comments and guidelines for improvement)

Tutor: Signature: Date:

Marks: [ All marks are subject to external moderation and approval of board of examinations]
TITLE

 Microcontroller Circuits

OBJECTIVES

 To get information about working foundation with Proteus software and MikroC software
 To get a knowledge and data about PIC16F877a microchip

INTRODUCTION

 The objective of this experiment is to implement a simple circuit on a breadboard and to introduce the
basic steps of microcontroller programming.

APPARATUS

 MikroC software
 Proteus software

PRE-LAB WORK
Refer the datasheet of PIC16F877a and answer the following questions.

01. What is the minimum and the maximum operating voltage of PIC16F877a?
 Minimum-2V
 Maximum-5.5V

02. What is the size of the,

a) Program memory used in PIC16F877a?

 14 kilobytes

b) RAM used in PIC16F877a?

 368 bytes

c) EEPROM used in PIC16F877a?

 256/HEF

03. What is the maximum operating frequency of PIC16F877a ?

 256MHz
04. State the number of input/output pins available in PIC16F877a and name those.

 Number of input pins-33


 Number of output pins-7

Pin Pin Name Description


Number

1 MCLR/Vpp MCLR is used during programming, mostly connected to


programmer like PicKit

2 RA0/AN0 Analog pin 0 or 0th pin of PORTA

3 RA1/AN1 Analog pin 1 or 1st pin of PORTA

4 RA2/AN2/Vref- Analog pin 2 or 2nd pin of PORTA

5 RA3/AN3/Vref+ Analog pin 3 or 3rd pin of PORTA

6 RA4/T0CKI/C1out 4th pin of PORTA

7 RA5/AN4/SS/C2out Analog pin 4 or 5th pin of PORTA

8 RE0/RD/AN5 Analog pin 5 or 0th pin of PORTE

9 RE1/WR/AN6 Analog pin 6 or 1st pin of PORTE

10 RE2/CS/AN7 7th pin of PORTE

11 Vdd Ground pin of MCU

12 Vss Positive pin of MCU (+5V)

13 OSC1/CLKI External Oscillator/clock input pin

14 OSC2/CLKO External Oscillator/clock output pin

15 RC0/T1OSO/T1CKI 0th pin of PORT C

16 RC1/T1OSI/CCP2 1st pin of POCTC or Timer/PWM pin

17 RC2/CCP1 2nd pin of POCTC or Timer/PWM pin

18 RC3/SCK/SCL 3rd pin of POCTC

19 RD0/PSP0 0th pin of POCTD

20 RD1/PSPI 1st pin of POCTD


21 RD2/PSP2 2nd pin of POCTD

22 RD3/PSP3 3rd pin of POCTD

23 RC4/SDI/SDA 4th pin of POCTC or Serial Data in pin

24 RC5/SDO 5th pin of POCTC or Serial Data Out pin

25 RC6/Tx/CK 6th pin of POCTC or Transmitter pin of Microcontroller

26 RC7/Rx/DT 7th pin of POCTC or Receiver pin of Microcontroller

27 RD4/PSP4 4th pin of POCTD

28 RD5/PSP5 5th pin of POCTD

29 RD6/PSP6 6th pin of POCTD

30 RD7/PSP7 7th pin of POCTD

31 Vss Positive pin of MCU (+5V)

32 Vdd Ground pin of MCU

33 RB0/INT 0th pin of POCTB or External Interrupt pin

34 RB1 1st pin of POCTB

35 RB2 2nd pin of POCTB

36 RB3/PGM 3rd pin of POCTB or connected to programmer

37 RB4 4th pin of POCTB

38 RB5 5th pin of POCTB

39 RB6/PGC 6th pin of POCTB or connected to programmer

40 RB7/PGD 7th pin of POCTB or connected to programmer


OBSERVATION & RESULTS
Exercise 01 – Blinking an LED

 Circuit was built according to the lab sheet.


 Code

Exercise 02 – Blinking an array of LEDs


 Circuit was built to exercise 2 in Proteus software
 Code
DISCUSSION
In this lab experiment exercise 2 we have to blink 8 LEDs by using PIC16F877A. Mainly get the
knowledge about the PIC16F877A. First of all, read the data sheet and get the idea about the micro
controller. Then, done the pre lab part of this experiment. Using the Proteus software and MikroC
software for done the exercise 1. The code for blinking 1 LED given in the lab sheet.
After that, exercise 2 done by using 8 LEDs. Create the circuit in Proteus software and code write
according to the exercise 1. Code is given bellow.

void main()
{
TRISB=0X00; //set the port B as an output
PORTB=0X00; //initialize the port B
while(1) //loop continuously happen
{
PORTB=0X00; //set the port B as logic low(LEDs are off)
delay_ms(1000); //down for the 1000ms
PORTB=0Xff; //set the port B as logic high(LEDs are on)
delay_ms(1000); //up for the 1000ms
}
}

Next, run the circuit after that 8 LEDs are blinking. Finally 8 LEDs are blinking continuously.

You might also like