EECC250 - Shaaban #1 lec #10 Winter99 1-6-2000 The Motorola 68230 PI/T Port A Data Register, PADR: $0FF010 Data Direction Register, PADDR: $0FF004 Port.

Slides:



Advertisements
Similar presentations
Microprocessor & Interfacing
Advertisements

The 8051 Microcontroller and Embedded Systems
PROGRAMMABLE PERIPHERAL INTERFACE -8255
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.
The Motorola Parallel Interface Timer (PI/T)
4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
Programmable Interval Timer
Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati.
EECC250 - Shaaban #1 Lec # 6 Winter Stack-Related Instructions PEA Push Effective Address Calculates an effective address and pushes it.
Chapter 10 Input/Output Organization. Connections between a CPU and an I/O device Types of bus (Figure 10.1) –Address bus –Data bus –Control bus.
8253/54 Timer Section /54 Timer Description and Initialization
Programmable Keyboard/ Display Interface: 8279
External Interrupt Module MTT EXTERNAL INTERRUPT REQUEST MODULE (IRQ)
Microprocessor and Microcontroller
I/O Unit.
68HC11 Polling and Interrupts
Programmed I/O (Polling)
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
EECC250 - Shaaban #1 Lec # 4 Winter Computer Input and Output (I/O) One of the basic and essential features designed in a computer system is.
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
8254 Programmable Interval Timer
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.
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
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
8254 Counter/Timer Counter Each of the three counter has 3 pins associated CLK: input clock frequency- 8 MHz OUT GATE: Enable (high) or disable.
System Clocks.
M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.
8254 SOFTWARE PROGRAMMABLE TIMER/COUNTER
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Chapter 4 TIMER OPERATION
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
MICROPROCESSOR INPUT/OUTPUT
PIT Programming Examples Working with the modes of PIT.
Timers.
Direct Memory Access (DMA) Microprocessors I -1. Topics to be discussed  Basic DMA Concept Basic DMA Concept  DMA pins and timing DMA pins and timing.
University of Tehran 1 Microprocessor System Design Timers Omid Fatemi
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
1 Interrupts, Resets Today: First Hour: Interrupts –Section 5.2 of Huang’s Textbook –In-class Activity #1 Second Hour: More Interrupts Section 5.2 of Huang’s.
8254 Timer.
1 68HC11 Timer HC11 or HC12: Chapter HC11 Timer Subsystem  Several timing functions: Basic timing Basic timing Real time interrupts Real time.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
Real Time Interrupts Section Real-Time Interrupt (RTI) Most operating systems (OS) require an interrupt every T seconds by the RTI RTI interrupts.
PROGRAMMABLE PERIPHERAL INTERFACE -8255
بسم الله الرحمن الرحيم MEMORY AND I/O.
1 68HC11 Timer. 2 68HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output compare.
Computer Operating Properly Module MTT COMPUTER OPERATING PROPERLY MODULE (COP)
8255:Programmable Peripheral Interface
Timer Programming in Assembly and C Prepared By:
Homework Reading Machine Projects Labs
Timer and Interrupts.
Programmable Interval Timer
Programmable Interval Timer
Programmable Interval Timer 8254 LECTURE 3
8254 Timer and Counter (8254 IC).
Timers.
Programmable Interval timer 8253 / 8254
8-bit Timer/Counter2 with PWM and Asynchronous Operation
Programmable Interval timer 8253 / 8254
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Programmable Peripheral Interface
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
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.
Programmable Interval Timer
Presentation transcript:

EECC250 - Shaaban #1 lec #10 Winter The Motorola PI/T Port A Data Register, PADR: $0FF010 Data Direction Register, PADDR: $0FF004 Port A Control Register, PACR: $0FF00C Port B Data Register, PBDR: $0FF012 Data Direction Register: PBDDR: $0FF006 Port B Control Register, PBCR: $0FF00E Port General Control Register PGCR: $0FF000 Port Status Register PSR: $0FF1A 8 bits wide Port A Port B H1-H4 TCR TSR CPRH, CPRM,CPRL CNTRH, CNTRM, CNRL Timer Control Register (TCR): $0FF20 Timer Status Register (TSR) at : $0FF34 Counter preload register CPR: CPRH, CPRM, CPRL Counter register CNTR: CNTRH, CNTRM, CNTRL

EECC250 - Shaaban #2 lec #10 Winter RS(5-1) __ R/W CS* CLK Reset* Control and Status Port A Handshake Port B Port C Timer/ Prescaler PA (7-0) H1 H2 H3 H4 PB (7-0) PC7 / TIACK* PC6 / PIACK* PC5 / PIRQ* PC4 / DMAREQ* PC3 / Tout PC2 / Tin PC1 PC0 D(7-0) 5 Data Bus Block Diagram

EECC250 - Shaaban #3 lec #10 Winter PIT Timer Functions Timers are devices which include a clocked counter which is usually decremented every clock cycle towards zero. By loading the counter with an initial value, one can generate a specific delay between staring the counter and the time it reaches zero. The uses a 24-bit counter for its timer functions. Functions Possible: –Generate square wave of any frequency (reload after reaching zero). –Generate single pulse of any width –Generate periodic interrupts to the CPU –Measure elapsed time (or frequency)

EECC250 - Shaaban #4 lec #10 Winter PIT Timer Block Diagram Data Bus clock CLK T in PC2 Timer Enable bit. (TCR0) EN 24 CPRH Data Bus CPRM CPRL 24 bit counter zero detect CNTRH T out PC3 to CPU Interrupt line (IRQ) Prescale / 32 CNTRM CNTRL Counter Register Counter Preload Register Zero-detect Status bit (TSR0) PIT+$2E PIT+$32 PIT+$26 PIT+$2A

EECC250 - Shaaban #5 lec #10 Winter PIT Timer Can be driven by clock as is, or divided by 32 (prescaled), or by an external clock connected to pin T in (pin PC2 of port C). 8-bit Timer Control Register (TCR) at: PIT + $20 8-bit Timer Status Register (TSR) at : PIT + $34 –When the counter reaches zero it sets the zero-detect Status, ZDS, ( bit 0 of the TSR). –ZDS is set automatically and has to be cleared by writing a one into it. T out (pin PC3 of port C) is usually connected to one of the interrupt lines and used to interrupt the CPU when count reaches zero. Counter preload register CPR: 3, 8-bit registers CPRH, CPRM, CPRL –Found at addresses: (PIT +$26, $28, $2A) –Address PIT + $24 has no real register but used as fake address for CPR to complete a long word. Counter register CNTR: 3, 8-bit registers CNTRH, CNTRM, CNTRL –Found at addresses (PIT +$2E, $30, $32) –Address PIT + $2C has no real register but used as fake address for CNTR to complete a long word.

EECC250 - Shaaban #6 lec #10 Winter PIT EQU $0FF000 Base Address of PI/T PGCR EQU PITPort General Control Register PSRR EQU PIT+2Port service request register PADDR EQU PIT+4Data direction register A PBDDR EQU PIT+6Data direction register B PCDDR EQU PIT+$08Data direction register C PIVR EQU PIT+$0APort Interrupt Vector register PACR EQU PIT+$0CPort A control register PBCR EQU PIT+$0EPort B control register PADR EQU PIT+$10Port A data register PBDR EQU PIT+$12Port B data register PCDR EQU PIT+$18Port C data register PSR EQU PIT+$1APort status register TCR EQU PIT+$20Timer control register TIVR EQU PIT+$22Timer interrupt vector register CPR EQU PIT+$24Dummy address of preload register CPRH EQU PIT+$26Timer preload register high CPRM EQU PIT+$28Timer preload register middle CPRL EQU PIT+$2ATimer preload register low CNTR EQU PIT+$2CDummy address of timer register CNTRH EQU PIT+$2ETimer register high CNTRM EQU PIT+$30Timer register middle CNTRL EQU PIT+$32Timer register low TSR EQU PIT+$34Timer status register Addresses of Timer Related Registers Addresses of Port Related Registers Registers Address Equates

EECC250 - Shaaban #7 lec #10 Winter Format of Timer Control Register (TCR) TCR7 TCR6 TCR5 TCR4 TCR3 TCR2 TCR1 TCR0 Tout/TIACK* Control Zero-detect Control Clock Control Timer Enable None 0 load from CPR 1 roll over on zero detect Set function of port C lines including interrupt usage (PC3/Tout) Set source of timer clock Scaled by 32 or not Bit 0 Disable 1 Enable Still none ;-)

EECC250 - Shaaban #8 lec #10 Winter TCR Format for Different Timer Modes Mode TCR7 TCR6 TCR5 TCR4 TCR3 TCR2 TCR1 TCR0 Tout/TIACK* Control ZD Control Clock Control Timer Enable None X X 1 X X 1 X or 1X 0 0 X Mode 1 = Real-time clock Mode 2 = Square wave generator Mode 3 = Interrupt after timeout Mode 4 = Elapsed time measurement Mode 5 = Pulse counter Mode 6 = Period measurement

EECC250 - Shaaban #9 lec #10 Winter Delay Subroutine Example Using Timer The following subroutine DELAY can be called by a main program to introduce a delay in execution, no parameters are passed to DELAY: Reset the timer. Pre-load the timer with a value (determines delay). Keep checking ZDS (busy looping) until the timer hits zero then return to calling program; no result is passed back. ORG $2000 DELAY MOVE.B#$00,TCRDisable/Reset timer MOVE.L#500000,D0Load D0 with a very large value :-) LEACPR,A0Load A0 with fake address of CPR MOVE.LD0,(A0)Preload the counter MOVE.B#$01,TCREnable the timer TCR0 = 1 WAIT BTST#0,TSRCheck ZDS if done BNEWAITLoop until counter hits zero RTSDone return to main program STOP#$2700