Lectures Slides
Microprocessor Systems and Interfacing, Fall 2020
by
Syed Mashhood Murtaza,
Department of Electrical & Computer Engineering,
COMSATS University, Islamabad – Abbottabad Campus
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
Circuits, HardwarE
&
Conceptual UnderstandinG
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Designing Schematics of Circuits in Proteus
PIC18f452 Microcontroller's pin out Diagram
Pin 1 MCLR and the concept of 'active low' inputs
Pins 11, 12, 33 and 34 and their use as power input (Vdd & Vss (Gnd))
Pins 13 and 14 and their use for inputting the clock signal through an external
oscillator
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Designing Schematics of Circuits in ProteusPIC18f452 Microcontroller's pin out Diagram
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Designing Schematics of Circuits in ProteusPIC18f452 Microcontroller's pin out Diagram
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Designing Schematics of Circuits in Proteus
PIC18f452 Microcontroller's pin out Diagram
Pin 1 MCLR and the concept of 'active low' inputs
Pins 11, 12, 33 and 34 and their use as power input (Vdd & Vss (Gnd))
Pins 13 and 14 and their use for inputting the clock signal through an external
oscillator
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
PIC18f452 Microcontroller's pin out Diagram
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Designing Schematics of Circuits in Proteus
PIC18f452 Microcontroller's pin out Diagram
Pin 1 MCLR and the concept of 'active low' inputs
Pins 11, 12, 33 and 34 and their use as power input (Vdd & Vss (Gnd))
Pins 13 and 14 and their use for inputting the clock signal through an exter
Oscillator
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
PIC18f452 Microcontroller's pin out Diagram / Important Pins
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Discussion about clock speed (frequency and time-period) and the maximum
allowed clock frequency for usual computers, microcontrollers and the
PIC18F452
Concept of Multiplexed pins (same pin can be connected to multiple internal
devices of the Microcontroller. Internal controlling registers select which device
the pin connects to at a particular time)
Pins associated with the (five) 5 digital I/O ports
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
PIC18f452 Microcontroller's pin out Diagram / Digital Ports
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microcontroller's internal register associated with the ports for storing the I/O
values - the PORTX register (where X is A,B,C,D or E)
Microcontroller's internal register associated with the port for controlling
whether the ports is to be an input or output port - the TRISX register (where
X is A,B,C,D or E)
The circuit of '2 oppositely directed Tri-States' that is controlled by the TRISX
register's nth bit to make the PORTX's nth pin act as an input or output pin
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Pins associated with the Analog to Digital Converter for taking analog input
The difference between analog and digital inputs
Use of digital ports for turning external devices on & off
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
PIC18f452 Microcontroller's pin out Diagram / ADC Input Pins
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
The two (2) possible circuits for connecting an LED to an output pin (from t
ANODE side turning ON when output is high '1' or from the CATHODE side:
turning ON when output is LOW '0')
Use of digital ports for displaying on off patterns
The speed of human interaction relating to the Microcontroller's output (time
required for perceiving the change in a visual output)
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
The two (2) possible circuits for connecting an LED to an output pin (from the
ANODE side turning ON when output is high '1' or from the CATHODE side:
turning ON when output is LOW '0')
Use of digital ports for displaying on off patterns
The speed of human interaction relating to the Microcontroller's output (time
required for perceiving the change in a visual output)
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Use of digital ports for controlling 'the intensity of an LED', 'speed of a mot
etc using PWM
Explanation of PWM and its utilities
Use of PWM for inputing analog values such as e.g., 'distance to an obstacle
from an ultrasonic sensor' through a digital port
Use of digital ports for controlling multiple outputs from the same pins using
time multiplexing
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Use of digital ports for controlling 'the intensity of an LED', 'speed of a motor'
etc using PWM
Explanation of PWM and its utilities
Use of PWM for inputing analog values such as e.g., 'distance to an obstacle
from an ultrasonic sensor' through a digital port
Use of digital ports for controlling multiple outputs from the same pins using
time multiplexing
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Explanation of PWM
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Use of digital ports for controlling 'the intensity of an LED', 'speed of a motor'
etc using PWM
Explanation of PWM and its utilities
Use of PWM for inputing analog values such as e.g., 'distance to an
obstacle from an ultrasonic sensor' through a digital port
Use of digital ports for controlling multiple outputs from the same pins using
time multiplexing
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Use of digital ports for controlling 'the intensity of an LED', 'speed of a motor'
etc using PWM
Explanation of PWM and its utilities
Use of PWM for inputing analog values such as e.g., 'distance to an obstacle
from an ultrasonic sensor' through a digital port
Use of digital ports for controlling multiple outputs from the same pins usin
time multiplexing
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
The (eight) 8 LEDs of 7 segment displays and their alphabetical ordering
convention
Connecting 7-Segment Display LEDs in Common Anode and Common Cathode
configurations
Circuit for connecting multiple 7-Segment Displays from digital ports using
(transistors) switches controlled common-cathode connections
for time
multiplexing
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Human interaction with Microcontroller using human hands for giving input
(using switches)
The concept of pull up and pull down for ensuring the input value never
remains floating
The speed of human interaction relating to the Microcontroller's input (the
minimal time between two possible human physical interactions with switches
or keys)
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
C IRCUITS , HARDWARE & CONCEPTUAL UNDERSTANDING
The problem of bouncing switches and its solution (De-bouncing)
2
The use of output and input ports' pins for taking n inputs from 2n pins by
using Matrix Keypad
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
PROGRAMMING & SIMULATION
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
PROGRAMMING & SIMULATION
What is programming and why some people are afraid of programming
Understanding the dumb machine. Examples of a simpleton hired to ring the
school bell – how to make him understand the job
Statements & Conditional branches – paths & decisions, repeating paths –
loops. Example of the paths, possible turns, U-turns & repeated U-turns of
passenger Suzuki
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
PROGRAMMING & SIMULATION
Downloading, installing and configuring a compiler (e.g. MPLAB C18 compiler
in Proteus)
Programming and compiling (building) the simplest C program on
Microcontroller
Simulating the programmed Microcontroller Circuit in Proteus
What the default (#included) header file contains
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
PROGRAMING & SIMULATION
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
PROGRAMMING & SIMULATION
Programming the delay function to simulate a blinking LED (with reasonable
delay to blink visibly)
Programming to display digits on multiple 7-Segment Displays using push-
button input based multiplexing
Programming to display different digits on multiple 7-Segment Displays using
time multiplexing
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus
PROGRAMMING & SIMULATION
Learning to Program De-bouncing using delays
Lesser than two possible human physical interactions with switches or keys but
greater than the time for transients (bouncing) to settle down
Learning how the code of programs (functions, files etc) are organized in case of
larger projects
Microprocessor Systems & Interfacing, Fall 2020
by Syed Mashhood Murtaza, Department of Electrical & Computer Engineering,
COMSATS University Islamabad – Abbottabad Campus