Sei sulla pagina 1di 11

NUST COLLEGE OF

ELECTRICAL AND MECHANICAL ENGINEERING

Microprocessor and Microcontroller Based Design

LAB - I

COLLEGE OF
ELECTRICAL AND MECHANICAL ENGINEERING
PESHAWAR ROAD, RAWALPINDI
LAB 1
Introduction

Objectives
1. Introduction to Microprocessors and Microcontrollers.
2. PIC18F Hardware Setup
3. Introduction to Proteus and MPLAB IDE
4. Fabrication of experiment board having ICSP feature.

PIC18F4520
PIC18F4520 is an 8-bit microcontroller with following salient features.
 20 Interrupt Sources
 5 I/O Ports (A, B, C, D, E)
 4 Timers
 1 CCP Module
 1 ECCP Module
 Serial Communication
 Analog to Digital Converter – 13 Input Channels (10-bit Resolution)
 Available in 40 pin DIP. PIC18 are available in 28, 40 and 44 pin packages.

Port A, B, C and D are 8-bits ports while port E is 4-bit port.

Page 2 of 11
There are a total of 40-pins provided on PIC18F458/452/4520. Out of these 40 pins, 33 pins
are designated to port A, B, C, D and E. Rest of the pins are configured in an appropriate
manner to run the microcontroller. Following is the description of these pins:

Vdd (Vcc)
Two pins are used to provide supply voltage of +5V to the chip. This supply voltage is
provided at pin 11 and pin 32 of the PIC18F458/452/4520.

Vss (GND)
Two pins are used to provide ground (GND) to the chip. This ground reference is provided at
pin 12 and pin 31 of the PIC18F458/452/4520.

OSC1 and OSC2


OSC1 and OSC2 are used as clock source for PIC. Mostly quartz crystal oscillator is
connected to input pins 13 and 14. The two pins of oscillator are also connected to a capacitor
each. Whereas the other pins of the capacitor are connected to ground.

MCLR
Pin 1 is the MCLR pin (master clear reset). It is an active low input pin. When a low pulse is
provided to this pin the microcontroller resets. This is often referred to as power on reset
(POR). On giving a low pulse to the MCLR pin, all the registers are reset. Program counter,
WREG and stack pointer are set to 0.

Page 3 of 11
Page 4 of 11
MPLAB IDE
MPLAB Integrated Development Environment (IDE) is a free, integrated toolset for the
development of embedded applications on Microchip's PIC and dsPIC microcontrollers.

Proteus
Proteus is a software product of Lab Center Electronics. We shall be using following two
modules of proteus:
a. ARES (PCB Layout)
b. ISIS (VSM – Virtual Simulation Module)

ARES:
Proteus PCB design combines the ISIS schematic capture and ARES PCB
layout programs to provide a powerful, integrated and easy to use suite of tools for
professional PCB Design. All Proteus PCB design products include an integrated
shape based auto-router and a basic SPICE simulation capability as standard. More
advanced routing modes are included in Proteus PCB Design Level 2 and higher
whilst simulation capabilities can be enhanced by purchasing the Advanced
Simulation option and/or micro-controller simulation capabilities.

ISIS:
The Proteus Design Suite is wholly unique in offering the ability to co-simulate both
high and low-level micro-controller code in the context of a mixed-mode SPICE
circuit simulation. With this Virtual System Modelling facility, you can transform
your product design cycle, reaping huge rewards in terms of reduced time to market
and lower costs of development. If one person designs both the hardware and the
software then that person benefits as the hardware design may be changed just as
easily as the software design. In larger organizations where the two roles are
separated, the software designers can begin work as soon as the schematic is
completed; there is no need for them to wait until a physical prototype exists.

Page 5 of 11
Tasks

Task – I
Figure – 1 shows the truth table for a full adder.

Perform the following tasks:


1. Draw the schematic for full adder in proteus. Simulate the circuit and verify the
outputs.
2. Transform the schematic into a PCB layout. Use appropriate wire and pad thickness.
Draw the layout using auto-placer and auto-router.

Task – II
Create a new MPLAB Project. Write the provided code into editor and build the project.

Task – II
Design a schematic for simulation of PIC18F4520 HEX file. Design complete development
environment and run the given hex file to check the simulation.

Page 6 of 11
PCB Design and Fabrication
There are number of methods of PCB fabrication but we shall be discussing the acid method
used for etching. Following is a quick guide towards PCB fabrication.

Step – I: Designing the layout in CAD Software:


Prepare a layout of the circuit on any commonly used PCB designing software. A layout is a
design which interconnects the components according to the schematic diagram (circuit
diagram). Take a mirror image print of the layout on the OHP sheet using a laser printer.
Make sure that the design is correct with proper placement of the components.

Step – II: Print the Layout on Butter Paper

Page 7 of 11
Step – III: Transferring the Butter paper print onto the PCB Board.

 Place the printed side of the butter paper in contact with the copper side of the PCB
board.
 Fix the butter paper on the PCB board using tapes so that the butter paper gets fixed
and its movement gets restricted.
 Now iron the butter paper fixed on the board on the non printed side. Make sure the
iron is very hot. Keep on ironing until the tracks start appearing on the non printed
side of the butter paper.
 After you have stopped ironing allow the PCB to cool. You may place it in water to
cool it. Now remove the butter paper very carefully. Make sure the tracks do not get
apart from the board while removing the butter paper.

Page 8 of 11
Step – IV: Etching.
 Prepare etcher by making a bit concentrated solution of FeCl3. Be careful with the
solution since it is toxic.
 Place the PCB board in this solution and keep on moving the container to and fro.
After some time you will observe that PCB has etched completely.
 Now erase the tracks and you will observe that golden copper tracks start appearing.

Page 9 of 11
Step – V: Drilling and Stuffing.

Page 10 of 11
Assignment 1:
a. Fabricate a complete functional generic/trainer board for PIC18 with provision of
ICSP header for programming using PICKIT 3. Stuff the board with the list of
components provided. (DOS after two weeks).

b. Get the following tasks done before next lab (LAB - 2) if not done in LAB-1.
i. Install Proteus
ii. Install and configure MPLAB.

Page 11 of 11

Potrebbero piacerti anche