IO Subsystem IV Ports and peripherals. IO Subsystem (1) All devices connected to the system buses, other than memory and CPU – Input and output ports.

Slides:



Advertisements
Similar presentations
Chapter 6 General Purpose Input/Output
Advertisements

8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
PROGRAMMABLE PERIPHERAL INTERFACE -8255
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
External Interrupt Module MTT EXTERNAL INTERRUPT REQUEST MODULE (IRQ)
CHAPTER 4 I/O PORT PROGRAMMING. I/O Port Pins The four 8-bit I/O ports P0, P1, P2 and P3 each uses 8 pins All the ports upon RESET are configured as input,
8086.  The 8086 is Intel’s first 16-bit microprocessor  The 8086 can run at different clock speeds  Standard 8086 – 5 MHz  –10 MHz 
I/O Unit.
ECE 447 Fall 2009 Lecture 9: TI MSP430 Interrupts & Low Power Modes.
Introduction of Holtek HT-46 series MCU
Refer to Chapter 6, 9 in the reference book
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
ECE Lecture 1 1 L15 – Digital I/O Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
Chapter 6 – MSP430 Micro-Architecture. BYU CS/ECEn 124Chapter 6 - MSP430 Micro-Architecture2 Concepts to Learn… Computer Architecture MSP430 Micro-Architecture.
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
Chapter 6 – MSP430 Micro-Architecture
Input / Output CS 537 – Introduction to Operating Systems.
1 EKT 225 MICROCONTROLLER I CHAPTER 3 I/O PORT PROGRAMMING.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Embedded Systems Design 1 Lecture Set 6 I/O Ports.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
NS Training Hardware.
Input/ Output By Mohit Sehgal. What is Input/Output of a Computer? Connection with Machine Every machine has I/O (Like a function) In computing, input/output,
MICROPROCESSOR INPUT/OUTPUT
Input/Output. I/O Initiation & Control  Transfer of data between circuitry external to the microprocessor and the microprocessor itself.  Transfer of.
Basic I/O Interface A Course in Microprocessor
I/O PORTS (Simplest Peripherals) PORT A: 6 bits wide (7th and 8th bit always read as 0) PORT B: 8 bits wide PORT C: 8 bits wide PORT D: 8 bits wide.
By, Prof. Tambe S. S. S.N.D. College of Engineering and Research Center Department of Electrical Engineering.
I NTRODUCTION P IN CONFIGARATION O PERATING MODE.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Lecture 11 Low Power Modes & Watchdog Timers
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
Lecturers: Professor John Devlin Mr Robert Ross
UBI >> Contents Lecture 6 Operating Modes, General Purpose Input/Output and LCD Controller MSP430 Teaching Materials Texas Instruments Incorporated University.
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.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Input-Output Organization
Modes of transfer in computer
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.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Microcontroller Intel 8051 [I/O Ports]. Pin out of the 8051 –40 pin package –32 pins are used for the 4 ports. –V CC / V SS –ALE Address Latch Enable.
ECE Lecture 1 1 L15 –I/O Part II Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 9.
8255:Programmable Peripheral Interface
80C51 Block Diagram 1. 80C51 Memory Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits – i.e. addresses for only 256.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
CS4101 嵌入式系統概論 General Purpose IO
Chapter 6 General Purpose Input/Output
UNIT – Microcontroller.
Lesson Outline Peripherals Memory-Mapped IO Ports GPIO Multiplexing
CS4101 嵌入式系統概論 General Purpose IO
Dr. Michael Nasief Lecture 2
8086/8088 Hardware Specifications
E3165 DIGITAL ELECTRONIC SYSTEM
Blinking an LED Using MSP430ware to Control GPIO
Interfacing Memory Interfacing.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Parallel communication interface 8255
ECE 3430 – Intro to Microcomputer Systems
Lecture 9: TI MSP430 Interrupts & Low Power Modes
Presentation transcript:

IO Subsystem IV Ports and peripherals

IO Subsystem (1) All devices connected to the system buses, other than memory and CPU – Input and output ports (I/O): interface CPU with external world directly Input port Output port Input/Output port – Peripherals: May be only internal to system or may have also external connection

IO Subsystem (2) Input transaction: Information toward CPU Output transaction: Information from CPU Important (not exhaustive) peripherals: – Timers: Uses such as measuring time intervals between two events, generate interrupts at specified and many others. – Watchdog Timer (WDT): Safety device and/or timer – ADC and DAC: to deal with analog inputs/outputs.

IO Structure Data Registers: – Input and Output Control Registers: – Used for I/O and peripheral configuration Status registers: – Show information about information transfer or configuration status Control registers may contain status bits.

IO Mapped vs. Memory Mapped IO Mapped IO - Different sets of addresses - Different instructions for transfers Memory Mapped IO - Same system of addresses - Same instructions for transfers

IO Mapped vs Memory Mapped (2) IO mapped I/O has different sets of addresses for memory and for I/O subsystem – CPU distinguishes address with type of instruction Example: 8086 uses MOV for transfers to/from memory, OUT to transfer to Output port, and IN from port. – Routing of address bus is done by control bus according to instruction. Memory mapped I/O does not distinguish between types – User must know memory map (or “names”).

IO Ports: Remarks Input port – Buffered: Readable only at a given moment – Latched: Readable on demand – Must not be left floating – Interruptible or non interruptible Output port – “Always” Latched

Important Remark for Input Do not leave an input floating: If necessary use pull up or pulldown resistors Pulldown ResistorPullup Resistor

Example: MSP430 General Purpose I/O ports

General Purpose I/O (8 bits) Named P0 to P10 – Number of ports and available bits depends on model – P1 and P2 have interrupt capability Bit independently programmable Edge selectable interrupt capability Some series have individually programmable pulldown/pull-up resistors Depending on model, pins can be configured for special I/O

Simplified Hardware configuration: 1. Non interruptible port Data Registers Control Registers

Basic I/O Registers (1/3) Function Selection Register (PxSEL): Selects the connection for the pin, either to the port or to other peripheral(s) 0: Connected to port (default) 1: Connected to other module(s) To connect pin 1.2 to port (if necessary, since it is connected by default), clear bit 2 of (P1SEL) [bic.b #BIT2, &P1SEL] To connect pin 1.2 to module, set bit 2 of (P1SEL) [bis.b #BIT2, &P1SEL] Direction Register (PxDIR): Selects in or out direction function for pin – 1: Output direction – 0: Input direction (default) – Example: mov.b #0xF0, &P1DIR configures pins 4 to7 as outputs

Basic I/O Registers (2/3) Output Register (PxOUT): to write signal to output – To output the word 0x2A to port 2: (P2OT)  #2Ah [mov.b #0x2A,&P2OUT] Input Register (PxIN): Read only register – Example: mov.b &P1IN, R6 transfers input to R6 – Avoid writing to this register (power consumption and does nothing)

Multiple peripherals pins: (3/3) Several Function Select Registers (PxSEL y PxSEL2 for 2xx family): For exemple, in ‘2xx family – PxSEL -- PxSEL2: 00: I/O pin 01: Primary peripheral module 10: Reserved (device specific) 11: Secondary peripheral module Consult data sheets and user guides for specific information.

More Examples: To put pins 0, 1 and 6 of Port 3 in output mode and all the others as input: – (P3DIR)  # b [ mov.b #0x43,&P3RID] To put pins 0, 1 and 6 of Port 3 in output mode leaving the others unchanged: – (P3DIR)  # 0x43 OR (P3DIR) [ bis.b #0x43,&P3RID] To see if the input at pin 3 of input port 2 is high: – Test bit 3 of port 2 [bit.b #BIT3,&P2IN]

Interruptible I/O ports (P1 and P2) Each pin has individual interrupt capability which can be enabled or disabled independently of other pins. Has the same registers as non interruptible I/O ports, plus three additional registers (all read and write registers) Interrupt capability is lost when pin is selected for peripheral

Simplified Hardware Configuration: Interruptible port Control Registers Status Register

Interruptible Port Registers Interrupt Enable Register (PxIE): enables interrupt capability – 1 enabled, 0 disabled – Interrupt requests from I/O ports are maskable – Interrupt capability is lost if pin is used for other module. Interupt Edge Select Register (PxIES): – 1: high to low, 0 low to high Interrupt Flags (PxIFG) – Automatically set when interrupt is generated – Writable, so interrupt may be generated by software – ATTENTION: I/O IFG Reset only by software – 0: no interrupt pending, 1: interrupt pending

I/O Ports with Pull-up Pull-down Resistor (Example from MSP430g2211 data sheet. Consult specific information for other models. Diagram is not complete) PSEL PDIR Pout PREn Condition 0 0 x 0 IN, no R In, R pull down IN, pull up R Out 0 1 x 1 Illegal Use with module

Remarks In your launchpad: Check if R-pull up is connected at P1.3 if using push-button (see next slide) – If not, connect with software: bic.b #BIT3,&P1DIR ; verify input status bis.b #BIT3,&P1REN ; connect resistor and bis.b #BIT3,&P1OUT ; set it as pull up Make an habit to set unused port pins as outputs.

Pull-up Resistor