Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.

Slides:



Advertisements
Similar presentations
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. Very Easy – Question 1 Easy – Question 2 OK, If u have read the book/slide – Question 4 – Question 5 A.
Advertisements

Parul Polytechnic Institute
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
DMA Controller (8237 Programming Examples)
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati I/O + Timer 8155 I/O + Timer 8255 I/O 8255 I/O 8253/54 Timer 8253/54 Timer 2 Port (A,B), No Bidirectional.
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
Programmable Interval Timer
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
8253/54 Timer Section /54 Timer Description and Initialization
TK2633 Introduction to Parallel Data Interfacing DR MASRI AYOB.
Engineering 4862 Microprocessors Lecture 23 Cheng Li EN-4012
82C55 82C55 Programmable Peripheral Interface Interfacing Part III.
The 8085 Microprocessor Architecture
Microprocessor and Microcontroller
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
kashanu.ac.ir Microprocessors 10-1 IO Devices Stepper Motors DAC, ADC, PPI Lec note 10.
Chapter 10 Input/Output Interface Circuits and LSI Peripheral Devices
Microcomputer & Interfacing Lecture 2
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
ENEE 440 Chapter Timer 8254 Register Select The 8254 timer is actually 3 timers in one. It is an upgraded version of the 8253 timer which was.
8253 TIMER. Engr 4862 Microprocessors 8253 / 8254 Timer A.k.a. PIT (programmable Interval Timer), used to bring down the frequency to the desired level.
PIT: Programmable Interval Timer
The 8253 Programmable Interval Timer
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.
Computer Architecture Lecture 9 by Engineer A. Lecturer Aymen Hasan AlAwady 10/2/2014 University of Kufa - Information Technology Research and Development.
Timers.
Applications of PPI A/D - Temperature Sensor. Analog to Digital.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
8086/8088 Hardware System. Typical Microprocessor Memory System CPU Memory Control Address Data.
Programmable Peripheral Interface Parallel port Interface 8255
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
Computer Architecture Lecture 6 by Engineer A. Lecturer Aymen Hasan AlAwady 1/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
PPI-8255.
EE3721 Computer System Principles
UNIT-IV 8255 PPI Various Modes Of Operation Interfacing To 8086.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Basic I/O Interface Fixed Address Variable Address
EE365 - Microprocessors period 26 10/23/00 D. R. Schertz # Parallel Ports.
Computer Architecture Lecture 5 by Engineer A. Lecturer Aymen Hasan AlAwady 25/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
8255:Programmable Peripheral Interface
Intel 8255A PPI EEE 365 [FALL 2014] LECTURE ATANU K SAHA BRAC UNIVERSITY.
8255 Programmable Peripheral Interface
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Diagram of microprocessor interface with IO devices
Programmable Interval Timer
Programmable Interval Timer
8085 Microprocessor Architecture
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
8254 Timer and Counter (8254 IC).
PROGRAMMABLE PERIPHERAL INTERFACE -8255
8255.
Parallel communication interface 8255
Timers.
Programmable Interval timer 8253 / 8254
Programmable Peripheral Interface
8085 Microprocessor Architecture
82C55 Programmable Peripheral Interface
8259 Programmable Interrupt Controller
Programmable Interval timer 8253 / 8254
Programmable Peripheral Interface
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
8085 Microprocessor Architecture
Programmable Interval Timer
The Programmable Peripheral Interface (8255A)
Presentation transcript:

Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati

Review – Programmable Interface device 8155 Block diagram, Address Calculation diagram Interfacing LED using Timer – Modes of timer – Square wave generation using 8155 interfaced timer 8155 Handshake & Interrupt mode Interfacing A/D Converter using Handshake mode using 8155

RAM Port A Port A Port B Port B Port C Port C Timer MSB LSB Timer MSB LSB PA0-PA7 PB0-PB7 PC0-PC5 Timer Out Reset in RD WR ALE CE IO/M AD0-AD Timer CLK

3 to 8 Decoder CWR Port A Port A Port B Port B Port C Port C Timer MSB LSB Timer MSB LSB Latch Clock for timer PA0-PA7 PB0-PB7 PC0-PC5 Timer Out A0 A1 A2 ALE AD0-AD7 A0-A7 D7-D CE b A2A1A0Port (ALE high, AD0=A0) 000Command /Status Register 001PA 010PB 011PC 100Timer LSB 101Timer MSB

3 to 8 Decoder 3 to 8 Decoder 0404 A13 A12 A11 A15 A14 A2 A1 A0 5V 3 to 8 Decoder RAM Con trol CWR Port A Port A Port B Port B Port C Port C Timer MSB LSB Timer MSB LSB Latch Clock for timer PA0-PA7 PB0-PB7 PC0-PC5 Timer Out Reset in RD WR A0A0 A1A1 A2A2 ALE CE IO/M AD0-AD7 A0-A7 D7-D0 20H 21H 22H 23H 24H 25H CS Instruction IN/OUT : Both Lower Address & Higher Address are same D7/A15D6/A14D5/A13D4/D12D3/A11D2/A10D1/A9D0/A

3 to 8 Decoder RAM Con trol CWR Port A Port A Port B Port B Port C Port C Timer MSB LSB Timer MSB LSB Latch Clock for timer PA0-PA7 PB0-PB7 PC0-PC5 Timer Out Reset in RD WR A0 A1 A2 ALE CE IO/M AD0-AD7 A0-A7 D7-D H 21H 22H 23H 24H 25H

D0, D1: mode for PA and PB, 0=IN, 1=OUT D2, D3: mode for PC D4, D5: interrupt EN for PA and PB, 0=disable 1=enable D6, D7: Timer command: – 00: No effect – 01: Stop if running else no effect – 10: Stop after terminal count (TC) if running, else no effect – 11: Start if not running, reload at TC if running. Port C bits (D2, D3) D7D6D5D4D3D2D1D0 Timer CommandIEBIEAPCPBPA ALTD3D2PC5PC4PC3PC2PC1PC0 100IN 201OUT 310 STB A BF A INTR A 411STB B BF B INTR B STB A BF A INTR A

Registers A2A1A0Port (ALE high, AD0=A0) 000Command/Status Register 001PA 010PB 011PC 100Timer LSB 101Timer MSB

8155 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 AD7 to AD0 IO/M b ALE RD b WR b RESET OUT IO/M b ALE RD b WR b RESET OUT 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 3 to 8 Decoder 3 to 8 Decoder 0404 A13 A12 A11 A15 A14 A2 A1 A0 5V

Port Address – Control Register=20H, Port A= 21H, Port B= 22H Control word: Program – MVIA,03 ; initialize Port A &B for O/P – OUT 20H – MVI A, BYTE1; Display BYTE1 at port A – OUT21H – MVIA, BYTE2; Display BYTE2 at port B – OUT22H D7D6D5D4D3D2D1D TimerNot Applicable Use for Port C Port B Output Port A Output

M2, M1: mode bits: – 00: Single square wave of wavelength TC/2 (TC/2,TC/2 if TC even; [TC+1/2],[TC-1/2] if TC odd) – 01: Square waves of wavelength TC (TC/2,TC/2 if TC even; [TC+1/2],[TC-1/2] if TC odd) – 10: Single pulse on the TC'th clock pulse – 11: Single pulse on every TC'th clock pulse. MSB M2M1T13T12T11T10T9T8 LSB T7T6T5T4T3T2T1T0

– 00: Single square wave of wavelength TC/2 (TC/2,TC/2 if TC even; [TC+1/2],[TC-1/2] if TC odd) – 01: Square waves of wavelength TC (TC/2,TC/2 if TC even; [TC+1/2],[TC-1/2] if TC odd) – 10: Single pulse on the TC'th clock pulse – 11: Single pulse on every TC'th clock pulse. CLK WR Mode 00 Mode 01 Mode 10 Mode 11 N/2 N NN

Design a square wave with pulse width 100μS Mode 1 Clock Frequency 3 MHZ Timer count: Pulse Period/Clock period = 200x10 -6 /330x10 -9 = 606 = 25E H = 02 (MSB), 5E (LSB)

Timer port address: LSB 24H & MSB 25H Mode 1; M1=0, M2=1 – M1 M2 T13 T12 T11 T10 T8 T7 – == (42H) Control word: (C0H) Instructions to set counter & square wave generation D7D6D5D4D3D2D1D0 Timer CommandIEBIEAPCPBPA MVI A, 5E ; LSB of count OUT24H; Load LSB of timer Register MVI A, 42H; MSB count with Mode 1 MVI 25H; Load MSB of timer Register MVIA, C3H; Load the control word for register OUT20H; Trigger the counter by loading to Ctrl word to ctrl Reg MVI A, 5E ; LSB of count OUT24H; Load LSB of timer Register MVI A, 42H; MSB count with Mode 1 MVI 25H; Load MSB of timer Register MVIA, C3H; Load the control word for register OUT20H; Trigger the counter by loading to Ctrl word to ctrl Reg

Two Handshake signal (STB, IBF) Steps in data input from IN device using 8155 – Peripheral put data in data line & send handshake signal STB – Device inform Peripheral that IN port is full, don’t send next byte until read by IBF signal – Either MPU check status or Device interrupt to MPU for Reading data from Device MPU Programmable Interfacing Device Programmable Interfacing Device Peripheral (IN) Such as Keyboard Peripheral (IN) Such as Keyboard System Data Bus RD b Data lines STB (Strobe) IBF-IN Buff Full Status Check INTR

– MPU writes byte to the out port of Device by sending WR b signal – Device inform the peripheral by sending handshake OBF, that a byte on the way – Peripheral ACK the byte by signal to device – Device Interrupt the MPU to ask to next byte or MPU check the status of Device MPU Programmable Interfacing Device Programmable Interfacing Device Peripheral (OUT) Such as Printer Peripheral (OUT) Such as Printer System Data Bus WR b Data lines ACK OBF-OutBuff Full Status Check INTR

Port A and B: configured in Handshake mode Port A uses PC0, PC1, PC2 of Port C Port B uses PC3, PC4, PC5 of Port C 8155 PC0 PC1 PC2 PC3 PC4 PC5 Port A Port B INTR A BF A STB b A INTR B BF B STB b B Port A with Handshake Port B with Handshake

Control signals – STB b (Strobe input): – BF (Buffer Full): – INTR (INTerrupt Request): Rising edge of STB b if INTE =1 – INTE (INTerrupt Enable): D4 and D5 for Port A & B Input, Output : As discussed earlier Status word: – MPU check the status Reg of port or timer – Control register & Status register have same port – Differentiated by RD b and WR b signals

Set up Port A in the handshake mode to read data from A/D Converter Setup port B as output port to display data at seven segment LEDs Use line PC3 from port C to initiate a conversion Use the 8155 Timer to record conversation time

Control word Status word Timer (with effecting other I/O assignment) – Start timer – Stop timer D7D6D5D4D3D2D1D TimerNA (INTR not used) Use for Port C Port B OUT to LED Port A IN from DAC 06H CH=O/P CL=Handshake Mode CH=O/P CL=Handshake Mode D7D6D5D4D3D2D1D0 NoX XXXXBFaX USe TimerINTEbBFbINTRbINTAaBFaINTRa Read the Data Mask with 02H Read the Data Mask with 02H C6H 46H

8155 PA7 PA6 PA5 PA4 PA3 PA2 PA1 PA0 AD7 to AD0 IO/M b ALE RD b WR b RESET OUT IO/M b ALE RD b WR b RESET OUT PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 7 Seg LED Driver 3 to 8 Decoder 3 to 8 Decoder 0404 A13 A12 A11 A15 A14 A2 A1 A0 ADC 5790 ADC 5790 Analog Input ViVi DR b B/C b PC2 PC3 Port CH = O/P PC3 is used for Start Conversion Port CL = HS mode PC2 is STROBE

MVIA,06H;Control world for I/O port OUT20H; Set up port as specified MVI A,00H; Load 0000H in Timer Reg OUT 24H OUT25H MVIA,08H;Byte to set PC3=1 OUT23H;Send start pulse MVI A,C6H;Control word to start timer MVI 20H; Start timer MVIA,00H;Byte to set PC3=0 OUT23H;Start conversion ST:IN 20H; Read Status Register ANI 02H;Check Status of DR b JZ ST; If BF a =0 wait in MVIA,06H;Control world for I/O port OUT20H; Set up port as specified MVI A,00H; Load 0000H in Timer Reg OUT 24H OUT25H MVIA,08H;Byte to set PC3=1 OUT23H;Send start pulse MVI A,C6H;Control word to start timer MVI 20H; Start timer MVIA,00H;Byte to set PC3=0 OUT23H;Start conversion ST:IN 20H; Read Status Register ANI 02H;Check Status of DR b JZ ST; If BF a =0 wait in MVI A,46H ; Byte to stop Counter OUT 20H ;Stop Counter IN 21H ; Read A/D output OUT 22H ;Display data at port B (LEDs) INT 24H ; Read LSB of Timer MOV L,A INT 25H ; Read MSB of Timer ANI 3FH ;Mask the mode Bit D6,D7 MOV H,A ; Save MSB timer count in H LHLD RWM ; Store the count at ;Memory location RWM HLT MVI A,46H ; Byte to stop Counter OUT 20H ;Stop Counter IN 21H ; Read A/D output OUT 22H ;Display data at port B (LEDs) INT 24H ; Read LSB of Timer MOV L,A INT 25H ; Read MSB of Timer ANI 3FH ;Mask the mode Bit D6,D7 MOV H,A ; Save MSB timer count in H LHLD RWM ; Store the count at ;Memory location RWM HLT

R S Gaonkar, “Microprocessor Architecture”, Chapter 14