#1 of 10 Tutorial Introduction PURPOSE -To explain how to configure and use the Timer Interface Module in common applications OBJECTIVES: -Identify the.

Slides:



Advertisements
Similar presentations
More fun with Timer/Counters
Advertisements

4-1 Timers Timers can be used for  timing  event counting  pulse width measurement  pulse generation  frequency multiplication There are 8 Timers.
Microcontroller Programming II MP6-1
Programmable Interval Timer
Sistemi Elettronici Programmabili13-1 MULTI OSC + CLOCK FILTER LVD POWER SUPPLY CONTROL 8 BIT CORE ALU PROGRAM MEMORY RAM I2CI2C PORT A SPI PORT B 16-BIT.
ECT 357 Ch 16 Output Control. Today’s Quote: The measure of a man is not how great his faith is bt how great his love is. The measure of a man is not.
EET 2261 Unit 10 Enhanced Capture Timer  Read Almy, Chapter 20.  Homework #10 and Lab #10 due next week.  Quiz next week.
Introduction of Holtek HT-46 series MCU
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.
ATtiny2313 Timers/Counters CS-423 Dick Steflik. What Do You Use Timers For? Timing of events (internal or external)‏ Scheduling Events Measuring the width.
Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 F PWMmax = x 50ns = 78 kHz Pulse Width Modulation Unit (PWM) (20 MHz)  4 independent.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Timer Interface Module MTT TIMER INTERFACE MODULE (TIM)
16-Bit Timer/Counter 1 and 3 Counter/Timer 1,3 (TCNT1, TCNT3) are identical in function. Three separate comparison registers exist. Thus, three separate.
1 Timing System Timing System Applications. 2 Timing System components Counting mechanisms Input capture mechanisms Output capture mechanisms.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Module Introduction Purpose  This training module provides an overview of the different.
ECE 371- Unit 11 Timers and Counters (“Stop Watches and Alarm Clocks”)
7/23 Timers in Coldfire Processor Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
ARM Timers.
System Clocks.
M Semiconductor Products Sector Computer Operating Properly Module Detail Slide #1 of 7 Tutorial Introduction PURPOSE -To explain how to configure and.
MS_uC / fue1 / V TIMx - Timer Programming Microcontroller TIMx - Timer Autumn term 2012.
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Unit 10.2 Timer Examples. Example – Music Generation Channel 6 – Set up as a timer Output to Generate Square Waves Channel 4 – Set up as a timer Output.
Timer Peripherals.
AT91 Embedded Peripherals
1 ARM University Program Copyright © ARM Ltd 2013 Timer Peripherals.
ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
ECE 447: Lecture 8 Timer System (1). ECE 447: 68HC11 Timer System 1.Generating delays - imposing a specific delay between two points in the program by.
ELE22MIC Lecture 18 The AVR Sleep Modes The ATMEGA128’s Timer System
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
Appendix B: System Development Example MTT48 V2.1 B - 1 APPENDIX B: SYSTEM DEVELOPMENT.
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.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
PULSE WIDITH MODULATION EE 587 Presented by Viswanadha Kakarlapudi.
Timer 1 and 2 operation, PWM Principles. Timer 1 Operation.
M Semiconductor Products Sector Low Voltage Inhibit Module Slide #1 of 3 Tutorial Introduction PURPOSE -To explain how to configure and use the Low Voltage.
1 68HC11 Timer. 2 68HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output compare.
Timers Presented by: Griffin Reid Rohit Vardhan Freddie Wilson Date: October 25, 2005.
Seth Schwiethale James Crosetto James Ellison.  square pulse of ms, repeats every 20 ms  It is the same for both steering and acceleration 
EET 2261 Unit 13 Enhanced Capture Timer
16F877A.
Why are Timer Functions Important?
Lecture 10: TI MSP430 Timers and Capture Modes
V.V.P. ENGINEERING COLLEGE,RAJKOT
ECE 3430 – Intro to Microcomputer Systems
AVR Addressing Modes Subject: Microcontoller & Interfacing
RX 8-Bit Timer (TMR) 4/20/2011 Rev. 1.00
Freescale ARM Timer Programming
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.
Timer/Counter Modified from Dr. Lam Phung’s Slides.
8-bit Timer/Counter0 with PWM
PWM and DC Motor Control
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
Programmable Interval timer 8253 / 8254
8-bit Timer/Counter2 with PWM and Asynchronous Operation
Programmable Interval timer 8253 / 8254
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
Example 18 Pulse Train Using Interrupts
Wave Generation and Input Capturing
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.
MCO556 Timer System Exercise.
Timer/Counter Timer/Counter 0 Timer/Counter 1 Timer/Counter 2 8 bit
Presentation transcript:

#1 of 10 Tutorial Introduction PURPOSE -To explain how to configure and use the Timer Interface Module in common applications OBJECTIVES: -Identify the steps to set up and implement an output compare function. -Identify the steps to set up and implement an input capture function. -Identify the steps to set up and implement both unbuffered and buffered pulse width modulation functions. -Identify the differences between unbuffered and buffered PWMs. CONTENTS: -20 pages -6 questions LEARNING TIME: -45 minutes PREREQUISITE: -68HC08 CPU Training Module

#2 of 10 Timer Interface Module Block Diagram 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A CH0F ELS0A TOV0 CH0MAX CH0IE Port Logic Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A CH1F ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH1 Timer Reference Timer Channel 0 Timer Channel 1 CH0IE Interrupt Logic CH1IE Interrupt Logic TOIE Interrupt Logic TOF 16-bit Comparator TMOD 16-bit Counter PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A CH0F ELS0A TOV0 CH0MAX CH0IE Port Logic Interrupt Logic MS0B TnCH0 MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A CH1F ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TnCH1

#3 of 10 Timer Interface Module Time Reference TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter TSTOP TRST Internal Bus Clock PS2PS1PS0 Prescaler 16-bit Counter TSTOP TRST PS2PS1PS0 Prescaler TOF TOIE Interrupt Logic 16-bit Comparator TMOD

#4 of 10 Timer Interface Module Time Reference TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter TSTOP TRST Internal Bus Clock PS2PS1PS0 Prescaler 16-bit Counter TSTOP TRST PS2PS1PS0 Prescaler TOF TOIE Interrupt Logic 16-bit Comparator TMOD

#5 of 10 Timer Interface Module Output Compare Overview 16-BIT FREE RUNNING COUNTER 16-BIT OUTPUT COMPARE LATCH PIN CONTROL LOGIC OCx Interrupt Enable Request Interrupt Status Flag 16-BIT COMPARE = ? 16-BIT COUNTER 16-BIT COMPARE Clear (05 & 08) Set (05 & 08) Toggle (08 Only)

#6 of 10 Timer Interface Module Output Compare Overview 16-BIT FREE RUNNING COUNTER 16-BIT OUTPUT COMPARE LATCH PIN CONTROL LOGIC OCx Interrupt Enable Request Interrupt Status Flag 16-BIT COMPARE = ? 16-BIT COUNTER 16-BIT COMPARE Clear (05 & 08) Set (05 & 08) Toggle (08 Only)

#7 of 10 Timer Interface Module Output Compare Applications Perform a simple timed event Perform a periodic interrupt event Implement a single pulse with variable width Generate a pulse width modulated signal

#8 of 10 Timer Interface Module Output Compare Function 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A ELS0A TOV0 CH0MAX CH0IE Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A CH1F ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH :0General Purpose I/O 0:1Toggle Output on Compare 1:0Clear Output on Compare 1:1Set Output on Compare TCH0 16-bit Counter ELS0BELS0A CH0F TnCH0 Port Logic

#9 of 10 Timer Interface Module Input Capture Overview 16-BIT FREE-RUNNING COUNTER 16-BIT INPUT CAPTURE LATCH EDGE SELECT & DETECT ICx Latch Request Interrupt Rising Edges (05 & 08) Falling Edges (05 & 08) Any Edge (08 Only) Status Flag Interrupt Enable

#10 of 10 Timer Interface Module Input Capture Applications Perform time reference to an external event Measure an input period Measure the width of an input pulse Provide additional external interrupts

#11 of 10 Timer Interface Module Input Capture Function 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A ELS0A TOV0 CH0MAX CH0IE Port Logic Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A ELS1A TOV1 CH1MAX CH1IE Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH1 0 0:0General Purpose I/O 0:1Capture on Rising Edge 1:0Capture on Falling Edge 1:1Capture on Either Edge TCH1 16-bit Counter ELS1BELS1A CH0F TnCH1 CH1F Port Logic 0

#12 of 10 Timer Interface Module PulseWidth Modulation Overview Period Duty Cycle 25% Duty Cycle PWM Period Duty Cycle 50% Duty Cycle PWM

#13 of 10 Timer Interface Module Unbuffered Pulse Width Modulation 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A ELS0A TOV0 CH0MAX CH0IE Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A CH1F ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH :0General Purpose I/O 0:1Toggle Output on Compare 1:0Clear Output on Compare 1:1Set Output on Compare TCH0 16-bit Counter ELS0BELS0A CH0F TnCH0 TCH0 TMOD ELS0BELS0A10 11 Compare TMOD Overflow Port Logic 1 TMOD  TCH0 Duty Cycle = TMOD TCH0 Period Pulse Width Toggle on Overflow 16-bit Comparator

#14 of 10 Timer Interface Module Unbuffered Pulse Width Modulation 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A ELS0A TOV0 CH0MAX CH0IE Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A CH1F ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH :0General Purpose I/O 0:1Toggle Output on Compare 1:0Clear Output on Compare 1:1Set Output on Compare TCH0 16-bit Counter ELS0BELS0A CH0F TnCH0 TCH0 TMOD ELS0BELS0A10 11 Compare TMOD Overflow Port Logic 1 TMOD  TCH0 Duty Cycle = TMOD TCH0 Period Pulse Width Toggle on Overflow 16-bit Comparator

#15 of 10 Timer Interface Module Unbuffered Pulse Width Modulation Overflow Interrupt New TCH Value Period Overflow Interrupt Overflow Interrupt Too Late! Compare Interrupt Compare Interrupt New TCH Value Compare Interrupt New TCH Value Too Late! Compare Interrupt Compare Interrupt New TCH Value Period TCH < TCNT New TCH Value Intermediate TCH Value Compare Interrupt

#16 of 10 Timer Interface Module Unbuffered Pulse Width Modulation Overflow Interrupt New TCH Value Period Overflow Interrupt Overflow Interrupt Too Late! Compare Interrupt Compare Interrupt New TCH Value Compare Interrupt New TCH Value Too Late! Compare Interrupt Compare Interrupt New TCH Value Period TCH < TCNT New TCH Value Intermediate TCH Value Compare Interrupt

#17 of 10 Timer Interface Module Unbuffered Pulse Width Modulation Overflow Interrupt New TCH Value Period Overflow Interrupt Overflow Interrupt Too Late! Compare Interrupt Compare Interrupt New TCH Value Compare Interrupt New TCH Value Too Late! Compare Interrupt Compare Interrupt New TCH Value Period TCH < TCNT New TCH Value Intermediate TCH Value Compare Interrupt

#18 of 10 Timer Interface Module Buffered Pulse Width Modulation 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A ELS0A TOV0 CH0MAX CH0IE Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH1 X 1 0:0General Purpose I/O 0:1Toggle Output on Compare 1:0Clear Output on Compare 1:1Set Output on Compare TCH0 16-bit Counter CH0F TnCH0 TMOD Port Logic 1 ELS0BELS0A Period TCH1CH1F Toggle on Overflow X XX 16-bit Comparator

#19 of 10 Timer Interface Module Buffered Pulse Width Modulation 16-bit Comparator TCH0 16-bit Latch ELS0B MS0A ELS0A TOV0 CH0MAX CH0IE Interrupt Logic MS0B 16-bit Comparator TCH1 16-bit Latch ELS1B MS1A ELS1A TOV1 CH1MAX CH1IE Port Logic Interrupt Logic TOF TOIE Interrupt Logic 16-bit Comparator TMOD 16-bit Counter Internal Bus PS2PS1PS0 PrescalerTSTOP TRST Internal Bus Clock TnCH0 TnCH1 X 1 0:0General Purpose I/O 0:1Toggle Output on Compare 1:0Clear Output on Compare 1:1Set Output on Compare TCH0 16-bit Counter CH0F TnCH0 TMOD Port Logic 1 ELS0BELS0A Period TCH1CH1F Toggle on Overflow X XX 16-bit Comparator

#20 of 10 Question What happens when the value in the output compare register is equal to the value in the 16-bit time reference counter? Click on the BEST choice. a) The output compare flag is set. b) An output compare interrupt is generated if enabled. c) The output pin is set, cleared, or toggled if enabled. d) The output pin is toggled if the toggle on overflow option is enabled. e) a, b, and c f) All of the above

#21 of 10 Question What is the fastest frequency that can be achieved for a 6-bit PWM when using a 68HC08 with an 8 MHz bus frequency? Click on your choice. a) 500 kHz b) 250 kHz c) 125 kHz d) 62.5 kHz e) kHz

#22 of 10 Question Does the 16-bit timer reference counter count up or count down? Click on your choice. a) Count up b) Count down c) Programmable up or down

#23 of 10 Question What type of input signal event(s) can the timer be programmed to detect before a valid input capture? Click on your choice. a) Rising Edge only b) Falling Edge only c) Rising and/or Falling Edge

#24 of 10 Question Is the output compare interrupt option recommended to change the duty cycle in unbuffered PWMs? Click on your choice. a) Yes b) No c) Does not matter

#25 of 10 Question Is the counter overflow interrupt option recommended to change the duty cycle in buffered PWMs? Click on your choice. a)Yes b) No c) Does not matter

#26 of 10 Tutorial Completion -TIM Configuration -Output Compare -Input Capture -Unbuffered PWM -Buffered PWM