For further information

Slides:



Advertisements
Similar presentations
1 ECE 372 – Microcontroller Design Parallel IO Ports - Outputs Parallel IO Ports E.g. Port T, Port AD Used to interface with many devices Switches LEDs.
Advertisements

Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
Parallel ports, power supply, and the clock oscillator Chapter Three Dr. Gheith Abandah1.
Digital I/O Connecting to the Outside World
Lecture – 7 Basic input and output
ECE 447 Fall 2009 Lecture 6: TI MSP430 IO Interfacing.
Microprocessor and Microcontroller Based Systems
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Embedded Systems Design
Microprocessor Block Diagram
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Decode 1.1 Decoder, Encoders and Displays ©Paul Godin Updated Aug 2013.
Parallel Ports, Power Supply and the Clock Oscillator Material to be covered  Parallel I/O ports  Interfacing external switches and LEDs  Clock Oscillator.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Microcontroller & Embedded System Subject Code : 6871 Semester : 7th Department.
MOBILE OPERATING ROBOT ON EMBEDDED SYSTEM
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
(More) Interfacing concepts. Introduction Overview of I/O operations Programmed I/O – Standard I/O – Memory Mapped I/O Device synchronization Readings:
Microprocessor-Based System. What is it? How simple can a microprocessor-based system actually be? – It must obviously contain a microprocessor otherwise.
Eng.Samra Essalaimeh Philadelphia University 2013/ nd Semester PIC Microcontrollers.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
Chapter 7 Larger Systems and the PIC 16F873A The aims of this chapter are to introduce: The architecture of the 16F873A microcontroller; The 16F873A memory.
Electronic. Analog Vs. Digital Analog –Continuous –Can take on any values in a given range –Very susceptible to noise Digital –Discrete –Can only take.
Basic LED Interface.
Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: the main features of a data acquisition system; the characteristics.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Chapter 12 Some PIC Microcontroller Advances The aims of this chapter are to introduce: To introduce in overview two microcontrollers which show some enhanced.
Chapter 3 Parallel Ports, Power Supply and the Clock Oscillator The aims of this chapter are to introduce: Why we need parallel input/output; How simple.
Department of Electronic & Electrical Engineering Introduction to microcontrollers A microcontroller is a small computer on a single integrated circuit.
WATER LEVEL INDICATOR AND AUTOMATIC MOTOR SWITCHING SYSTEM
Mobile phone keypad sensed password entry for door opening.
An Introduction to Embedded Systems, and the PIC Microcontroller Lecture 8: Interrupts The aims of this session are to explore the structure and application.
Application Case Study Christmas Lights Controller
Introduction to Motors, servos and steppers
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Basic Computer Organization and Design
The 8085 Microprocessor Architecture
Environment Temperature Monitor
Input/Output Ports and Interfacing
UNIT – Microcontroller.
CPU Sequencing 6/30/2018.
Lecture 6: TI MSP430 IO Interfacing
The 8085 Microprocessor Architecture
DIGITAL CALCULATOR USING 8051
COMP2121: Microprocessors and Interfacing
The 8255 Programmable Peripheral Interface
Interfacing different devices & considerations
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
EE Embedded Systems Fall 2015
Lesson 9: Digital Input-Output Signal Interfacing
Introduction to Microprocessors and Microcontrollers
Interfacing Memory Interfacing.
Chapter 7 Features and Interfacing of Programmable Devices for 8085 based systems.
Tiny Computers, Hidden Control
PROGRAMMABLE PERIPHERAL INTERFACE -8255
EE Embedded Systems Fall 2015
8255.
Parallel communication interface 8255
Introducing the PIC Mid-Range Family and the 16F84A
Copier Jam Detector Design Problem
Five Key Computer Components
The 8085 Microprocessor Architecture
Microprocessor I 7/18/2019.
The Programmable Peripheral Interface (8255A)
Presentation transcript:

For further information An Introduction to Embedded Systems Aug 2008 Lecture 3 Digital Input/Output and the 16F84A The aims of this lecture are to explore: why we need parallel input/output; how simple logic circuits can be developed to give a flexible interface between the microcontroller data bus and the outside world; how external devices can be connected to the parallel port; the parallel input/output available on the PIC 16F84A. For further information and background, read Pages 45-58. The copyright to all diagrams is held by Microchip Technology, or T. Wilmshurst, unless otherwise stated

Why Digital Input/Output? Almost any embedded system needs to transfer digital data between its CPU and the outside world. This transfer falls into a number of categories, which can be summarised as: Direct user interface, including switches, keypads, light emitting diodes (leds) and displays; Input measurement information, from external sensors, possibly being acquired through an analog to digital converter; Output control information, for example to motors or other actuators; Bulk data transfer to or from other systems or sub-systems, moving in serial or parallel form, for example sending serial data to an external memory. How can we provide the required interface between the microcontroller core and the outside world? More precisely, how do we get the data onto or off the data bus at the right moment?

Parallel Input/Output 2 We could apply a circuit like this for output. Here a pulse on the Port Select line captures data on the bus at that instant, and transfers it to the external pin. Two lines of Data Bus D Q Read/Write External Pin Port Select Flip-flop latches data bus value onto external pin, when memory location high whenever port address is is selected, AND Write is active selected D Q External Pin

Parallel Input/Output 2 Or we could apply a circuit like this for input. Here a pulse on the Port Select line transfers data on the external pin at that instant to the data bus. Two lines of Data Bus Read/Write External Pin buffer transfers logic value on external pin Port Select onto data bus line, when memory location is selected, AND Read is active External Pin

A Bi-Directional Port Pin Driver Circuit Read/Write Read/Write Read Port Read Port Or, we could combine both circuits into one multi-function circuit, like this. You don’t need to grasp all the detail of this circuit, although it’s neat if you can. There is now an extra flip-flop, labelled “Direction”. The state of this decides in which direction data will flow. The two flip-flops shown can each form one bit in an SFR, which can be controlled from the CPU. A group of these bits, each driven by a circuit like this, is called a “port” Data Bus Data Bus (bit n) (bit n) Input Buffer Input Buffer "Data" "Data" I/O Pin I/O Pin Output Buffer Output Buffer (bit n of an (bit n of an Write Write D D Q Q 8 8 - - bit port) bit port) Port Select Port Select Port Port holds bit holds bit output value output value 8 of these 8 of these flip-flops form buffer, enabled buffer, enabled flip - - flops form the "Data" SFR the "Data" SFR when pin is output when pin is output "Direction" "Direction" Write Write D D Q Q DDR DDR determines whether port determines whether port Direction Select Direction Select bit is input or output bit is input or output Alternate Input Alternate Input Function Function "Data" SFR "Data" SFR 8 of these flip 8 of these flip - - flops form flops form the "Data Direction" SFR the "Data Direction" SFR "Direction" SFR "Direction" SFR

Parallel Input/Output Ports 3 The 16F84A pins RB3:RB0 Holds output data From Option Register Output buffer Decoded address lines 0 on this line enables output buffer Value held determines data direction

SFRs for the 16F84A Parallel Ports The Port SFRs can be seen in the memory map, the detail repeated here. SFR named PORTX holds the input/output data for the port, ie it holds all the “Data Latch” bits for that port. The SFR named TRISX holds all the “TRIS Latch” bits for that port. The bits can be set independently, so one can be input while another output. They cannot be both at the same time. Ports A and B can easily be found on the pin connection diagram. Port A is only 5 bits, while Port B is 8. Note that some pins have several functions, as indicated on the diagram.

PIC 16F84A Port Input Characteristics (5V power supply) When designing with microcontroller digital I/O one needs to have an understanding of their electrical characteristics. 16F84A Input Characteristics The input of a logic gate or port pin requires the voltage to be below a certain maximum in order to be recognised as a logic 0, or above a certain minimum to be recognised as a logic 1. Minimum Input High Voltage, VIH 2.4V (TTL buffer inputs) Maximum Input Low Voltage, VIL 0.8V (TTL buffer inputs) Input Leakage Current, IIL +1mA PIC 16F84A Port Input Characteristics (5V power supply)

Simple Digital Interfacing – connecting to switches

Light Emitting Diodes (leds) - Review High Efficiency Red Yellow http://www.kingbright.com.tw/

Modelling a Logic Gate Output To connect the port bit output, we need an understanding of how its internal circuit behaves electrically. We can model it as shown. internal Logic 1 voltage switch is in this is the supply voltage position when output is at Logic 1 V V LH R S R S(high) V S(high) V L L R R S(low) S(low) V LL switch is in this position when output is at Logic 0 internal Logic 0 voltage is ground a) Generalised Model b) Model of CMOS Logic Gate Output

Driving LEDs from Logic Gates (and hence Port Bit Outputs) current flows out of the gate and lights led when output is at logic 1 I R D R current flows into gate and lights led when V D output is at logic 0 V I D D a) Gate Output Sourcing b) Gate Output Sinking Current to LED Current from LED Data for the 16F84A (when powered from 5V) shows an output resistances of approximately 130W when at logic high, and 36W when at logic 0.

Example. The circuit alongside, where the logic gate represents a 16F84A port pin output, is to be used to light either a red led (gate output high, gate is sourcing current), or a green led (gate output low, gate is sinking current). To balance light intensity levels the red led requires approximately 10mA of drive current, while the green requires approximately 14mA. At these currents the leds both have 1.8V of forward voltage. Calculate values for R1 and R2. The supply voltage is 5V. V S R 1 (green) V D1 R 2 (red) V D2 End of Lecture Note