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.

Slides:



Advertisements
Similar presentations
Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
Advertisements

Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Chapter 2 HARDWARE SUMMARY
Data acquisition and manipulation
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
Microprocessor and Microcontroller Based Systems
Microcontroller: Introduction
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
ENGR 355 Take Home Lecture 2 WRITING CODE Introductory Comments /* Disgruntled Avians Lab 6 ENGR355 by Tim Kyle Rev /1/2014 LM-3551 Tilt Sensor.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
Chapter 4 Starting to Program – an Introduction to Assembler The aims of this chapter are to introduce: the essentials of Assembler programming; the Microchip.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
RM2C Understanding Connections on the Robot Control Board (RCB).
Microprocessor Block Diagram
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
Lecture 12 Today’s topics –CPU basics Registers ALU Control Unit –The bus –Clocks –Input/output subsystem 1.
1 © Unitec New Zealand Embedded Hardware ETEC 6416 Date: - 10 Aug,2011.
Digital Fundamentals Floyd Chapter 1 Tenth Edition
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Objectives How Microcontroller works
Electronic Troubleshooting Chapter 10 Digital Circuits.
Introduction to Computing: Lecture 4
Decode 1.1 Decoder, Encoders and Displays ©Paul Godin Updated Aug 2013.
General Licensing Class Oscillators & Components Your organization and dates here.
Practical Digital Design Considerations Part 1 Last Mod: January 2008 ©Paul R. Godin.
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.
MOBILE OPERATING ROBOT ON EMBEDDED SYSTEM
One of the most important feature of the microcontroller is a number of input/output pins used for connection with peripherals. In the case of PIC 167CX,
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
PHY 202 (Blum)1 Analog-to-Digital Converter and Multi-vibrators.
Microprocessor-Based System. What is it? How simple can a microprocessor-based system actually be? – It must obviously contain a microprocessor otherwise.
Modern VLSI Design 2e: Chapter 3 Copyright  1998 Prentice Hall PTR Topics n Electrical properties of static combinational gates: –transfer characteristics;
Eng.Samra Essalaimeh Philadelphia University 2013/ nd Semester PIC Microcontrollers.
Chapter 1 Combinational CMOS Logic Circuits Lecture # 4 Pass Transistors and Transmission Gates.
PHY 201 (Blum)1 Transistor Odds and Ends. PHY 201 (Blum)2 RTL NOR.
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.
Automatic accident avoiding system PROJECT MEMBERS MUTHUKUMAR.K (05ME33) SAKTHIDHASAN.S (05ME39) SAKTHIVEL.N (05ME40) VINOTH.S (05ME56) PROJECT GUIDE:
Floyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd © 2008 Pearson Education Chapter 1.
THE MICROPROCESSOR A microprocessor is a single chip of silicon that performs all of the essential functions of a computer central processor unit (CPU)
Basic LED Interface.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
Presented by Sadhish Prabhu
Chapter 11 Data Acquisition and Manipulation The aims of this chapter are to introduce: the main features of a data acquisition system; the characteristics.
Chapter 12 Some PIC Microcontroller Advances The aims of this chapter are to introduce: To introduce in overview two microcontrollers which show some enhanced.
THEME 9: Multi-vibrators. Multi-vibrators in integral realization. Multi-vibrators (also called oscillators or pulse train generators) have two unstable.
Components of a typical full-featured microcontroller.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
MICROPROCESSOR AMARTYA ROY-72 ANGSHUMAN CHATTERJEE-80 ASHISH LOHIA-70 MOLOY CHAKRABORTY-60.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
Application Case Study Christmas Lights Controller
Clock Signals: 555 Timer 555 Timer Digital Electronics TM
For further information
UNIT – Microcontroller.
EE Embedded Systems Fall 2015
Interfacing Memory Interfacing.
Tiny Computers, Hidden Control
555 Timer 555 Timer Digital Electronics TM 1.2 Introduction to Analog
CSCI1600: Embedded and Real Time Software
Introducing the PIC Mid-Range Family and the 16F84A
Digital Fundamentals Floyd Chapter 1 Tenth Edition
555 Timer 555 Timer Digital Electronics TM 1.2 Introduction to Analog
MSP432™ MCUs Training Part 6: Analog Peripherals
CSCI1600: Embedded and Real Time Software
Presentation transcript:

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 parallel i/o logic circuits can be developed; How external devices can be connected to the parallel port; The parallel i/o available on the PIC 16F84A; The essential features of power supply and clock oscillator; The Microchip approach to power supply and oscillator; The hardware design of the electronic ping-pong game. Designing Embedded Systems with PIC Microcontrollers: Principles and Applications 2 nd Edition. Tim Wilmshurst Instructors using Designing Embedded Systems with PIC Microcontrollers are welcome to use or change these slides as they see fit. Feedback, to is The copyright to all diagrams is held by Microchip Technology, or T. Wilmshurst, unless otherwise stated

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? Why Digital Input/Output?

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. Data Bus External Pin Port Select QD Two lines of External Pin QD Read/Write Flip-flop latches data bus value onto external pin, when memory location is selected, AND Write is active high whenever port address is selected

Parallel Input/Output 2 Data Bus External Pin Port Select Two lines of buffer transfers logic value on external pin onto data bus line, when memory location is selected, AND Read is active External Pin Read/Write 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.

A Bi-Directional Port Pin Driver Circuit 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” D Q D Q "Direction" "Data" I/O Pin Read/Write Port Select Direction Select Data Bus (bit n of an 8-bit port) (bit n) Output Buffer Input Buffer Alternate Input Function "Data" SFR "Direction" SFR Read Port Write Port Write DDR buffer, enabled when pin is output determines whether port bit is input or output 8 of these flip-flops form the "Data Direction" SFR 8 of these the "Data" SFR holds bit output value flip-flops form D Q D Q "Direction" "Data" I/O Pin Read/Write Port Select Direction Select Data Bus (bit n of an 8-bit port) (bit n) Output Buffer Input Buffer Alternate Input Function "Data" SFR "Direction" SFR Read Port Write Port Write DDR buffer, enabled when pin is output determines whether port bit is input or output 8 of these flip-flops form the "Data Direction" SFR 8 of these the "Data" SFR holds bit output value - flip-flops form

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

Simple Digital Interfacing – connecting to switches Connecting switches to logic inputs. (a) SPDT connection. (b) SPST with pull-up resistor. (c) SPST with pull-down resistor

Light Emitting Diodes (leds) High Efficiency Red Yellow

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

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.

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

Port Input Characteristics 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, V IH 2.4V(TTL buffer inputs) Maximum Input Low Voltage, V IL 0.8V(TTL buffer inputs) Input Leakage Current, I IL +1  A PIC 16F84A Port Input Characteristics (5V power supply)

a) V OH vs. I OH (V DD = 3V, -40°C TO 125°C) 16F84A Port Output Characteristics, Logic High

b) V OL vs. I OL (V DD = 3V, -40°C TO 125°C) 16F84A Port Output Characteristics, Logic Low

The choice of microcontroller clock source determines some of its fundamental operating characteristics. While “faster is better” in terms of operating speed and programming execution, faster is definitely worse in terms of power consumption. All timed elements within the microcontroller almost invariably depend on the clock characteristics. If stable and accurate timing is required, then the clock oscillator must be stable and accurate. The clock source must therefore be chosen with care. Oscillators can be based on resistor-capacitor circuits, quartz crystal or ceramic. Read up about the relative advantages. The Microcontroller Oscillator R-C Oscillator CircuitsThe Quartz Crystal

The 16F84A can be configured to operate in four different oscillator modes, using R-C, crystal or ceramic oscillators. It can also accept an external clock source. The user selects which mode is to be used by setting bits in the Configuration Word. XT – Crystal The standard crystal configuration, intended for crystals or ceramics in the range 1MHz to 4MHz. HS – High Speed A higher drive version of the XT configuration, for higher frequency crystals and ceramic resonators. Intended for frequencies in the region of 4MHz or greater. It leads to the highest current consumption of all the oscillator modes. LP – Low Power Intended for low frequency crystal applications, and gives the lowest power consumption possible. Will however operate at any frequency below around 200kHz. RC - Resistor-Capacitor Requires connection of an external resistor and capacitor. The lowest cost way of getting an oscillator, but should not be used when any timing accuracy is required. The 16F84A Oscillator Modes

b) Resistor-Capacitor c) Externally Supplied Clock The 16F84A Oscillator Modes a) Crystal or Ceramic, HS, XT, or LPThe Oscillator Pins

The 16F84A R- C Oscillator Recommended component values for crystal and ceramic resonator oscillators can be found in the published data. Values for R-C oscillator are given graphically, with example below.

The 16F84A Power Supply The power supply connections are easily seen on the pin connection diagram. It is easy to get these mixed up – don’t!

The Need for Supply Decoupling Current is consumed on every clock transition I V s Internal Clock V min Supply voltage drops below minimum value on each current pulse Microcontroller V s I PCB Tracks add decoupling capacitor here Series inductance and resistance in supply line separates circuit from (ideal) voltage source

End of Lecture Note The Hardware Design of the Electronic Pingpong