Parallel I/O. Introduction oThis section focuses on performing parallel input and output operations on the 68HC11 o3 operation types oSimple, blind data.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
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.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
MC68HC11 System Overview. System block diagram (A8 version)
Programmable Interval Timer
Programmable Keyboard/ Display Interface: 8279
8255 – PROGRAMMABLE PARALLEL
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
82C55 82C55 Programmable Peripheral Interface Interfacing Part III.
8086.  The 8086 is Intel’s first 16-bit microprocessor  The 8086 can run at different clock speeds  Standard 8086 – 5 MHz  –10 MHz 
Microprocessor and Microcontroller
I/O Unit.
68HC11 Parallel I/O Chapter 7.
1 I/O and Interrupts Today: First Hour: I/O Concepts –Section of Huang’s Textbook –In-class Activity #1 Second Hour: Interrupt Code Example –In-class.
ELEC 330 Digital Systems Engineering Dr. Ron Hayne
EE 134 / EE 101 Spring, 2002 Lecture 19 Exam 2 Solutions.
8255 I/O. Overview 68HC11 pulse accumulator example: The Egg-O-Matic More about the Intel 8255A Overview of the Motorola 68HC24.
68HC11 Polling and Interrupts
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
ECE200 – Computer Organization Chapter 8 – Interfacing Processors and Peripherals.
Basic Input/Output Operations
Input-Output Problems L1 Prof. Sin-Min Lee Department of Mathematics and Computer Science.
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
INPUT-OUTPUT ORGANIZATION
Khaled A. Al-Utaibi  8086 Pinout & Pin Functions  Minimum & Maximum Mode Operations  Microcomputer System Design  Minimum Mode.
Memory interface Memory is a device to store data
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
UNIT 8 Keypad Interface Contact Closure Counter Exceptions (Interrupts and Reset)
Input/Output mechanisms
Input/Output Ports and Interfacing
The 8253 Programmable Interval Timer
MICROPROCESSOR INPUT/OUTPUT
Basic I/O Interface A Course in Microprocessor
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.
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:
Applications of PPI A/D - Temperature Sensor. Analog to Digital.
8279 KEYBOARD AND DISPLAY INTERFACING
Interrupt Interrupt – to break the flow of speech or action of (someone) by saying or doing something (Longman dictionary)
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
Module 11 Adapted By and Prepared James Tan © 2001.
PPI-8255.
8279 KEYBOARD AND DISPLAY INTERFACING
Programmable Interrupt Controller (PIC)
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Basic LED Interface.
Parallel I/O. Introduction This section focuses on performing parallel input and output operations on the 68HC11 3 operation types – Simple, blind data.
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 Bringing it all together: Exploring the EVB Today: First Hour: Bringing it all together by exploring the EVB –Section of Huang’s Textbook.
8255:Programmable Peripheral Interface
KEYBOARD/DISPLAY CONTROLLER - INTEL Features of 8279 The important features of 8279 are, Simultaneous keyboard and display operations. Scanned keyboard.
Intel 8255A PPI EEE 365 [FALL 2014] LECTURE ATANU K SAHA BRAC UNIVERSITY.
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
General Purpose I/O.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
The 8255 Programmable Peripheral Interface
Interfacing Memory Interfacing.
8255.
Serial Communication Interface: Using 8251
Parallel communication interface 8255
Programmable Peripheral Interface
82C55 Programmable Peripheral Interface
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
The Programmable Peripheral Interface (8255A)
Presentation transcript:

Parallel I/O

Introduction oThis section focuses on performing parallel input and output operations on the 68HC11 o3 operation types oSimple, blind data transfers oStrobed transfers oTransfers with handshaking oLook at examples of each transfer operation Contd …

SEGMENT code Introduction oReading: oText, Chap 9: oRead: 9.1, oScan: 9.2, 9.3 oE9: Section 6

7 Recall the block diagram of the 68HC11

Simple I/O operations oThese I/O operations take place under the direction of the processor oOperations are performed without regard to the status of the I/O port the port is always assumed to be "ready" Contd …

Simple I/O operations oSince the current status of the port is not known, it is possible to oRead the same value in more than once on input operations oOverwrite the current value in an output port that is waiting to be transferred o"Good" examples of use: oInput initialization values from a port port is in known state as a result of system reset oI/O when overwrites or multiple reads don't matter writing to the hex display’s port in the labs, for example

Simple I/O operations Simple I/O example -- keypad interface Consider the simple 12- key keypad shown below

Simple I/O operations Simple I/O example -- keypad interface Consider the simple 12- key keypad shown below

Simple I/O operations oHigh-level procedure to detect key closures oDrive Row 1 input low oRead Columns -- any =0? oRepeat this process for all remaining rows until “see” a column=0 oIf no column=0, then no key has been depressed

Simple I/O operations oKnowing which row and column were low permits you to calculate the key number that was pressed oCan use a simple equation (similar to the approach of Listing 9.5) oKey# = col# + (3*row#) -3 oAssumes row and col numbers start with 1 oListing 9.5 is for 2-of-7 keyboard! oOr use a lookup table (similar to the approach in Listing 9.10) o– Assumes row and col use same port (port C)

Simple I/O operations oKey debounce oNeed to avoid the multiple make/break closures associated with key bounce o“Simple” approach is ID the key closed and then wait for a period of time to see if the key is still closed (therefore not bouncing) oThen and only then, return the key value oThe waiting period will vary from switch to switch -- 10s to 100s of ms

Simple I/O operations oHow will the system react if you hold a key down for a long time? oShould an action (in response to a key closure) be repeated over and over despite there being only 1 switch closure “action” oShould the action take place only once and then wait for the key “break” before recognizing another closure? oConsider routines to recognize key makes and breaks

Strobed I/O oThis method of performing I/O operations uses a control line, the strobe, to notify the receiving unit of the availability of data at its (input) port oThe process: oDevice performing the write places data onto data bus (its output port) oStrobe signal is asserted (for 2 cycles in 68HC11) oStrobe signal causes data to be latched into input port of the receiving device Contd …

Strobed I/O oStrobe signal causes an I/O interrupt to occur or a flag to be set -- in either case the receiving device is signaled that new data has arrived oIt is up to the receiving device to read the new data at its input port in a "timely" fashion oProblem oIf a second data item arrives at the input port and is strobed in (latched) before the input device has read the first item, the first item will be overwritten and lost

Strobed I/O o68HC11 register support for strobed I/O oDDRC -- data direction register for port C oPORTCL -- port C input latch -- data is latched on STRA edge oPORTC -- input pins for port C -- not latched oPORTB -- latched output data port B – outputs data using STRB oPIOC -- parallel I/O control register oPORTD -- bits 6 and 7 are STRA and STRB Contd …

Strobed I/O

oStrobed input operations using port C oData is placed at the input pins of port C oSTRA is asserted by peripheral device, causing oData to be latched into PORTCL oSTAF flag to be asserted oInterrupt initiated, if interrupts are enabled oData is read into to processor from PORTCL oTo clear STAF, read PIOC first then PORTCL

Strobed I/O

oStrobed Output oPeripheral device is connected to Port B oWhen the MCU writes to Port B,... oData is placed on Port B pins oSTRB is asserted for 2 clock cycles oPeripheral device should use STRB to latch the data oSTRB can be configured as active-high or active-low

Handshaking I/O oIn this mode, the sending and receiving devices exchange positive sent/received signals to one another oInsures that each transmitted word is received before the next word is transmitted

Handshaking I/O oTransfers can occur in either the pulsed or the interlocked method oPulsed input operations oPeripheral pulses STRA to indicate that data is present oWhen 68HC11 reads the data (from PORTCL), it automatically generates an acknowledgment strobe on STRB for 2 cycles oThis mode is selected by initializing the PLS bit (bit 2 of the PIOC) to 1

Handshaking I/O oTransfers can occur in either the pulsed or the interlocked method oInterlocked input operations oHere, STRB acts as a READY signal oAsserted = 68HC11 ready to receive data oNegated = 68HC11 is not ready -- do not send data now

Handshaking I/O

oOutput operations with handshaking oPort C is used for output handshake operations, along with STRB and STRA o– STRB is the output "data available" strobe o– STRA is the acknowledgment / input ready strobe line oPIOC bit 3, OIN, set to 1 for output operations oPulsed operations o68HC11 writes data to PORTCL and automatically asserts STRB for 2 cycles oPeripheral device reads data upon receipt of the STRB strobe oPeripheral asserts its READY line (68HC11's input STRA line) to signal receipt of data oPIOC bit 2, PLS set to 1 for pulsed mode

Handshaking I/O oOutput operations with handshaking oInterlocked mode oUpon writing data to PORTCL, STRB is asserted oSTRB negated only upon ACK

Handshaking I/O

oHandshaking example: Centronics parallel printer interface oThe "Centronics" definition of a printer port interface has become the standard parallel printer interface

Handshaking I/O oUsing the 68HC11 as the output device (to the printer) requires a software interface (note the errors in the text!)

Handshaking I/O

; Listing 9.16 ; I/O service routines to control "Centronics" interface ; part of printer control system. Also demonstrates ; software handshaking because port C configured ; for simple input strobe. Main program would call ; service routines to store input data in a RAM print ; buffer for later output to print mechanism. ;;; CONNECTIONS ; Computer Printer Port MCU as Printer Controller ; DATA > Port C ; STB > STRA ; ACK < PD2 ; BUSY < PD3 ;; Contd …

Handshaking I/O PIOC CONFIGURATION DETAILS ; INVB=x STRB not used ; EGA=0 STRA/ACK active on falling edge ; PLS=x Pulsed/Interlocked not used ; OIN=x Output/input handshake not used ; HNDS=0 Simple strobe mode ; CWOM=0 Normal CMOS outputs ; STAI=0 Disable interrupt ; STAF=x Sets on falling STRA line ; To clear STAF, read PIOC, then read PORTCL Contd …

Handshaking I/O ORG $100 ; Subroutine INIT_INTRF ; Initializes parallel interface part ; of printer upon power-up reset. ; Calling Registers: ; IX = Address of register block ; No Return Registers except CCR affected Contd …

Handshaking I/O INIT_INTRF: psha ; preserve registers ldaa PIOC,X ; clear STAF if set Ldaa PORTCL,X bset PORTD,X $0C ; PD2, 3 output and bset DDRD,X $0C ; BUSY, ACK high ldaa #00 ; configure PIOC staa PIOC,X pula ; restore registers rts ; and return Contd …

Handshaking I/O ; Subroutine INPUT ; Reads parallel port to get byte sent ; by an external device ; Calling registers ; IX = Address of register block ; Return registers ; ACCA = input data byte ; CCR affected Contd …

Handshaking I/O INPUT: bclr PORTD,X $0C ; BUSY low and pulse ACK nop ; for approx 5 us (E=2MHz) bset PORTD,X $04 ; set ACK high again CIN: brclr PIOC,X $80 CIN ; wait for STB pulse ldaa PORTCL,X ; get input and clear STAF bset PORTD,X $08 ; set BUSY high rts ; return

Parallel subsystem summary oPorts B and C are available for I/O only in the single chip mode -- can be replaced by the PRU when in expanded mode oPort A o3 input, 3 output, 2 bi-directional pins oBits DDRA7 and DDRA3 in PACTL set direction for A7 and A3 oPort B oParallel output only (single chip mode) Contd …

Parallel subsystem summary oPort C oData register is PORTC oLatched register is PORTCL oEach bit is bi-directional oDirection set using register DDRC oPort D o6 bi-directional pins, directions set by DDRD oPin 6 = STRA, Pin 7 = STRB oThese pins become AS and R/W* in expanded multiplexed mode Contd …

Parallel subsystem summary oPort E o8-bit input only oConditions on reset oAll data direction bits set to 0 (input) oOutput port bits set to 0 oInput port bits high impedance Contd …

Parallel subsystem summary oStrobed I/O oStrobed output via Port B, strobed input via Port C oDetected edge on STRA causes input data to be latched in PORTCL and flag set (and interrupt, if enabled) oWriting data to Port B also pulses STRB oHandshake I/O oPort C used for either input or output operation oInput: read data from PORTCL oOutput: write data to PORTCL