Вы находитесь на странице: 1из 7

PAF KARACHI INSTITUTE OF ECONOMICS AND TECHNOLOGY

Department of Electrical

College of Engineering

EE3417 – Microprocessor Based System

Semester: Class ID:


Student name: Faculty Signature:
Student ID: Date of Experiment: ______
Remarks/Comments: _ ____

Lab Recall architecture of microprocessor and micro-controller, understand differences in their


1 implementation, familiarization with its registers, ALU physical pin out and assembly language.

PLO1 – Engineering Knowledge C1 – Recall


Bloom’s
PLO’s PLO5 – Modern Tool Usage P2 – Set
PLO8 – Ethics
Taxonomy A3 – Assume responsibility
LAB TASK PERFORMANCE
Excellent Average Poor
CLO’s Aspects of Assessments M
(75-100%) (50-75%) (<50%)
Recall: Recall the associated Complete understanding of the Understand the lab topic(s) Student lacks clear understanding
concepts form theory regarding concepts / actively participate concepts / participates less in of microprocessor and micro-
CLO1
microprocessor systems and during lecture /read & interpret class / get knowledge of module controller architecture and its
20%
architecture with interfacing different module usage in but unable to interpret accurately. module concepts/ Unable to clarify
techniques. microcontroller. the difference completely.
Tools Utilization Interfacing Successfully implement the Implement the interfacing logic Does not know how to interface a
CLO5 Different Input / Output interfacing logic to control all with less control of input / output peripherals device with micro-
70% peripherals devices with micro- input / output elements through elements through the Graphical controller.
controller. Graphical program. with program instruction.
Lab Safety Properly handle lab Properly handle lab equipment Moderate level lab handling and Minor or no safety measurements
CLO6
infrastructure/ safety & obey safety measures. safety measurements has been considered.
10%
precautions
Total Marks: 10

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk
Page 2 of 7
Microprocessor & Microcontroller overview

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk
Page 2 of 7
Criteria for choosing a microcontroller
1- It must meet the task.
i- Speed. What is the highest speed that the microcontroller supports?
ii- Packaging. Does it come in a 40-pin DIP (dual inline package) or a QFP (quad flat package), or
some other packaging format? This is important in terms of space, assembling, and prototyping
the product.
iii- Power consumption. This is especially critical for battery-powered products.
iv- The amount of RAM and ROM on the chip.
v- The number of I/O pins and the timer on the chip.
vi- Ease of upgrade to higher-performance or lower-power-consumption versions.
vii- Cost per unit. This is important in terms of the final cost of the product in which a
microcontroller is used.
2- The second criteria in choosing a microcontroller is how easy it is to develop products around it. Key
considerations include the availability of an assembler, debugger, a code-efficient C language compiler,
emulator, technical support.
3- The third criteria in choosing a microcontroller is its ready availability in needed quantities both now
and in the future. For some designers, this is even more important than the first two criteria.
PIC18 Features
The PIC18 has a RISC architecture that comes with some standard features such as on-chip program (code)
ROM, data RAM, data EEPROM, timers, ADC, and USART and I/O ports. Although the size of the above
specification may available.

Simplified view of PIC Microcontroller

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk
Page 2 of 7
Ports, Pins basic Input/output functions
The numbers of ports in the PIC18 family varies depending on the number of pins on the chips. The 40pin
PIC18F452 has five ports. They are PORTA, PORTB PORTC, PORTD and PORTE. To use any of these
ports as an input or output it must be programmed. In addition to being used for simple I/O, each port has
some other functions such as ADC, Timers, Interrupts and serial communication pins. The below figure
shows alternate functions for the PIC18F452 pins.
PIN Diagram

WREG register (working register)


In the CPU, registers are used to store information temporarily. That information could be a byte of data to be
processed, or an address pointing to the data to be fetched. Most of PIC registers are 8-bit registers. In the PIC
there is only one data type: 8-bit. The 8 bits of a register are shown in the diagram below.

STATUS register
The status register is an 8-bit register. It is also referred to as the flag register. Although the status register is 8
bits wide, only 5 bits of it are used by the PIC18. The three unused bits are unimplemented and read as 0. The
five flags are called conditional flags, meaning that they indicate some conditions that result after an instruction
is executed. These five flags are C (carry), DC (digital carry), Z (zero), OV (overflow), and N (negative).

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk
Page 2 of 7

For further information, see section 2.4 in book

PIC WREG and ALU using Literal Value

File register
The file register is read/write memory used by the CPU for data storage and registers for internal use and
functions. As with WREG we can perform arithmetic and logic operations on many locations of the file register
data RAM.

SFR (Special Function Registers).


The Special Function Registers (SFRs) are dedicated to specific functions such as ALU status, timers, serial
communication, I/O ports, ADC, and so on. The function of each SFR is fixed by the CPU designer at the time
of design because it is used for control of the microcontroller or peripheral. The PIC SFRs are 8-bit registers.

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk
Page 2 of 7
GPR (General Purpose Register or RAM)
The general-purpose registers are a group of RAM locations in the file register that are used for data storage.
Each location is 8 bits wide and can be used to store any data we want if it is 8-bit. The space that is not
allocated to the SFRs typically is used for general-purpose registers.

Familiarization with Assembly language


MOVLW 12H ; load value 12H into WREG (WREG = 12H)
ADDLW 16H ; add 16H to WREG (WREG = 28H)
ADDLW 11H ; add 11H to WREG (WREG = 39H)
ADDLW 43H ; add 43H to WREG (WREG = 7CH)
MOVLW 99H ;WREG = 99H
MOVWF 0H ;move (copy) WREG contents to location 0H
MOVWF 1H
MOVWF 2H
MOVWF 3H
MOVWF 4H

TRISX register role in input/output data


Each of the Ports A-E in the PICI 8F458 can be used for input or output. The TRISX SFR is used solely for making a
given port an input or output port.
Example to make a pin or port an output.
To make a port an output, we write 0’s to the TRISX register. In other words, to output data to any of the pins of the
PORTB, we must first put 0’s into the TRISB register to make it an output port, and then send the data to the PORTB
SFR itself.
Example to make a pin or port an input.
To make a port an input, we write 1’s to the TRISX register.
In other words, take input data to any of the pins of the PORTB, we must first put 1’s into the TRISB register to make
it an
input port, and then receive the data from the PORTB SFR itself.

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk
Page 2 of 7

Tool Usage:
Verify all the recall on the MPLAB IDE software through assembly programming.

Submission Details:
 Lab Manual
 Quiz

Microprocessor Based System Instructor:


College of Engineering Tooba Hai
PAF-Karachi Institute of Economics & Technology tooba@pafkiet.edu.pk

Вам также может понравиться