Reading Assignment. Timer. Introduction. Timer Overview. Programming HC12 Timer. An Overview of HC12 Timer. EEL 4744C: Microprocessor Applications

Similar documents
EEL 4744C: Microprocessor Applications Lecture 8 Timer Dr. Tao Li

Lecture 12 Timer Functions


Timing System. Timing & PWM System. Timing System components. Usage of Timing System

CS/ECE 6780/5780. Al Davis. Today s topics: Output capture Pulse Width Modulation Pulse Accumulation all useful options for Lab7 1 CS 5780

ME 6405 Introduction to mechatronics Fall Slide 1. Introduction Timer? Usage Electronics HC11 Conclusion. Timers

EE 308 Spring 2013 The MC9S12 Pulse Width Modulation System

Page 1. So Far. Usage Examples. Input Capture Basics. Familiar with CS/ECE 6780/5780. Al Davis. Trigger interrupts on rising/falling/both edges

Connecting a SMARTEC temperature sensor to a 68HC11 type of microcontroller

The MC9S12 Pulse Width Modulation System. Pulse Width Modulation

LM4: The timer unit of the MC9S12DP256B/C

Hardware Flags. and the RTI system. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Chapter 6 PROGRAMMING THE TIMERS

EEL 4744C: Microprocessor Applications. Lecture 9. Part 2. M68HC12 Serial I/O. Dr. Tao Li 1

Review for Final Exam

Course Introduction. Content 20 pages 3 questions. Learning Time 30 minutes

COE538 Microprocessor Systems Lab 6: Input Capture Interrupt 1

EE 308 Spring 2006 FINAL PROJECT: INTERFACING AND MOTOR CONTROL WEEK 1 PORT EXPANSION FOR THE MC9S12

Oct 30 Announcements. Bonus marked will be posted today Will provide 270 style feedback on multiple-choice questions. [3.E]-1

Greater Resolution for the QED s 8-bit DAC

EE 308 Apr. 24, 2002 Review for Final Exam

PWM System. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

ECE 4510/5530 Microcontroller Applications Chapter 8 ECT and PWM

EIE/ENE 334 Microprocessors

Review for Final Exam

Grundlagen Microcontroller Counter/Timer. Günther Gridling Bettina Weiss

Timer A (0 and 1) and PWM EE3376

Microcontrollers: Lecture 3 Interrupts, Timers. Michele Magno

CprE 288 Introduction to Embedded Systems (Output Compare and PWM) Instructors: Dr. Phillip Jones

Timer System Applications. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

ELCT 912: Advanced Embedded Systems

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

ATmega16A Microcontroller

ME 4447/6405 Pulse Width Modulation (PWM)

For reference only Refer to the latest documents for details

Table of Contents 1. Abstract 3 2. Executive Summary 4 3. Introduction 5 4. Integrated System 6 5. Mobile Platform 9 6.

ECE251: Tuesday October 3 0

Timer A. Last updated 8/7/18

Timer 0 Modes of Operation. Normal Mode Clear Timer on Compare Match (CTC) Fast PWM Mode Phase Corrected PWM Mode

VORAGO Timer (TIM) subsystem application note


HC08 SCI Operation with Various Input Clocks INTRODUCTION

Lab 5 Timer Module PWM ReadMeFirst

Freescale Semiconductor, I SECTION 11 TIME PROCESSOR UNIT

Topics Introduction to Microprocessors

Using the Z8 Encore! XP Timer

Pulse Width Modulation

The Need. Reliable, repeatable, stable time base. Memory Access. Interval/Event timers ADC DAC

ECE 4510/5530 Microcontroller Applications Midterm Review

Select the single most appropriate response for each question.

The 9S12 Pulse Width Modulation System Huang Sections 8.10 and 8.11 PWM_8B8C Block User Guide

Timer/Counter with PWM

EE251: Thursday October 25

Fixed-function (FF) implementation for PSoC 3 and PSoC 5 devices

Microcontrollers. Serial Communication Interface. EECE 218 Microcontrollers 1

Microcontroller: Timers, ADC

ME 333 Assignment 7 and 8 PI Control of LED/Phototransistor Pair. Overview

Hello and welcome to this Renesas Interactive Course that provides an overview of the timers found on RL78 MCUs.

Atmel ATmega328P Timing Subsystems. Reading

AN1734. Motorola Semiconductor Application Note

Speedy. by Josue Peña. Keith L. Doty EEL 5666 Intelligent Machines Design Laboratory

QUARTZ-MM PC/104 Counter/Timer & Digital I/O Module

Lecture 14 Analog to Digital Conversion

Period/Pulse-Width Accumulator TPU Function (PPWA)

dspic30f Quadrature Encoder Interface Module

UNIVERSITY OF VICTORIA FACULTY OF ENGINEERING. SENG 466 Software for Embedded and Mechatronic Systems. Project 1 Report. May 25, 2006.

AN1730. Digital Amplification Control of an Analog Signal Using the MC68HC705J1A. Introduction

MICROCONTROLLER TUTORIAL II TIMERS

EE 308 Lab Spring 2009

Microprocessor & Interfacing Lecture Programmable Interval Timer

Fixed-function (FF) implementation for PSoC 3 and PSoC 5LP devices

CMOS Serial Digital Pulse Width Modulator INPUT CLK MODULATOR LOGIC PWM 8 STAGE RIPPLE COUNTER RESET LOAD FREQUENCY DATA REGISTER

Measuring Distance Using Sound

Chapter 9: Serial Communication Interface SCI. The HCS12 Microcontroller. Han-Way Huang. September 2009

Description PWM INPUT CLK MODULATOR LOGIC 8 - STAGE RIPPLE COUNTER FREQUENCY DATA REGISTER 8 - STAGE SHIFT REGISTER SCK

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

IZ602 LCD DRIVER Main features: Table 1 Pad description Pad No Pad Name Function

HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 HT1627 HT16270 COM

PAK-VIIIa Pulse Coprocessor Data Sheet by AWC

CMOS Serial Digital Pulse Width Modulator INPUT CLK MODULATOR LOGIC PWM 8 STAGE RIPPLE COUNTER RESET LOAD FREQUENCY DATA REGISTER

HT162X HT1620 HT1621 HT1622 HT16220 HT1623 HT1625 HT1626 COM

PIC Functionality. General I/O Dedicated Interrupt Change State Interrupt Input Capture Output Compare PWM ADC RS232

Data Sheet. HCTL-2000 Quadrature Decoder/Counter Interface ICs HCTL-2000, HCTL-2016, HCTL-2020

PCL-836 Multifunction countertimer and digital I/O add-on card for PC/XT/ AT and compatibles

DS1073 3V EconOscillator/Divider

Counter/Timers in the Mega8

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by

Block Diagram , E I F = O 4 ) + J H 6 E E C + E H? K E J +,, H E L A H * E = I + E H? K E J + + % 8,, % 8 +, * * 6 A. H A G K A? O

PWM research and implementation on MCS-51

Hello, and welcome to this presentation of the FlexTimer or FTM module for Kinetis K series MCUs. In this session, you ll learn about the FTM, its

1 Contents 2 2 Overview 3 3 Hardware Interface 4 4 Software Interface Register Map Interrupts 7

PSoC 4 Timer Counter Pulse Width Modulator (TCPWM)

TKT-3500 Microcontroller systems

OBSOLETE. Bus Compatible Digital PWM Controller, IXDP 610 IXDP 610

Roland Kammerer. 13. October 2010

Built-in LCD display RAM Built-in RC oscillator

R/W address auto increment External Crystal kHz oscillator

High Speed Counter (HSC) Self-Help Guide

L13: (25%), (20%), (5%) ECTE333

DS1075 EconOscillator/Divider

Transcription:

Reading Assignment EEL 4744C: Microprocessor Applications Lecture 8 Timer Software and Hardware Engineering (new version): Chapter 4 SHE (old version): Chapter 0 HC Data Sheet: Chapters,,, 0 Introduction We want separate timing circuitry that runs independent of our main program Our main program can't keep good timing due to unexpected things like IRQ's A timer is just a digital counter Timer Overview Timer functionality we will studied ) Main Free Running Timer (TCNT) ) Timer Output Compare ) Timer Input Capture 4) Pulse Accumulator 5) Real Time Interrupt 6) Pulse Width Modulator Examples of application that use timer functionality ) Count items on an assembly line ) Generate a 0/70 duty cycle to control a motor ) Measure phase of an incoming signal 4) Generate an edge every n seconds 5) Latch data from peripheral when an edge occurs 6) Generate interrupt every 50ms An Overview of HC Timer 6-bit free-running counter based on system bus clock (e.g. E CLK) 8 timer channels, each configurable as: Output compare: can generate variety of waveforms by comparing counter vs. programmable register Input capture: latch value of counter on selected edge of timer input pins 6-bit pulse accumulator to count external events, or act as gated timer of internal pulses Programmable, periodic interrupt generator called RTI (real-time interrupt) Programming HC Timer Most complex subsystem of the HC, many control registers and bits All timer functions similarly programmed All have separate interrupt controls and vectors Interrupts enabled/disabled by bit in control register All have flags that get set when some programmable condition is satisfied (reset by program) Thus, when operation of one timer is learned, procedures similar for all others

Basic Timer The heart of the timers is a 6-bit, free running, Main Timer (TCNT) Other Timing functions are based off of this timer Its input clock from system bus clock, but may be prescaled via division by,, 4, 8, 6, or PR:PR:PR0 prescale factors in control register TMSK PR[:0] Bus Clk Divider 000 00 00 4 0 8 00 6 0 Basic Timer TCNT ($84:85) starts at $0000 on reset, runs continuously unless disabled or stopped (e.g. wait mode) Cannot be set by program in normal mode, but contents can be read at any time TCNT should be read by 6-bit read instruction (e.g. LDD $84) to fetch whole value Overflows after $FFFF, setting Timer Overflow Flag (TOF), which can use to extend range Timer Overflow Hardware Handling Timer Overflow TOF (bit-7 in TFLG register) can be used in two ways: polling or interrupting Polling program polls value of TOF; after asserted, must reset each time by writing to TOF bit Example: Using TOF to generate delay of ~s assuming 8MHz bus clock overflows, each of 64K periods of 5ns (8.9ms) 64K 5ns second! TOF Polling Example ;Constant Equates NTIMES: EQU ; Number of TOF's ;I/O Register Equates TFLG: EQU $8F ; TFLG register TSCR: EQU $86 ; Timer system ctrl. reg TOF: EQU %0000000 ; Timer overflow flag TEN: EQU %0000000 ; Timer enable ;Clear the TOF first ldaa #TOF staa TFLG ;Enable the timer wait bset TSCR,TEN ;Initialize the counter and for NTIMES ldaa #NTIMES staa counter ;spin WHILE TOF is not set spin: tst TFLG bpl spin ; Branch if TOF=0 ;After the TOF=, reset TOF 4 4 ldaa #TOF staa TFLG ;and decrement the counter dec counter ;IF counter!= 0 spin bne spin TOF Interrupt TOF can generate interrupt if TOI bit in TMSK register enabled, TOF interrupt vector is initialized in vector table, and I-bit unmasked in CCR Example: Use TOF interrupt to generate ~s delay TOFVect: EQU $FFDE ;TOF vector address NTIMES: EQU ;Number times to interrupt ;I/O Register Equates TOF: EQU %0000000; Timer Overflow Flag TOI: EQU %0000000; Timer Overflow Int TEN: EQU %0000000; Timer enable TSCR: EQU $86 ; Timer control reg TFLG: EQU $8F ; TFLG TMSK: EQU $8D ; TMSK offset See Next Page ;Initialization interrupt vector ORG TOFVect dc.w isr

TOF Interrupt Example ;Clear the TOF ;Timer Overflow ISR ldaa #TOF ;This ISR increments a Counter staa TFLG ;value on each interrupt. ;Enable the timer bset TSCR,TEN isr: inc Counter ; Clear the TOF bit ;Enable the interrupt system ldaa #TOF bset TMSK,TOI ; Enable timer overflow 4 staa TFLG cli ; Unmask hc interrupts rti ; Return to main prog ; Do Forever start: wai ; Wait for the interrupt ;When the counter incremented by the ISR ;reaches a maximum given ;by NTIMES, do some work and reset the ;Counter value. ;IF Counter = maximum ldaa Counter cmpa #NTIMES bne endif ;DO SOME WORK HERE ; and reset the Counter clra /4 staa Counter ;ENDIF Counter=maximum endif: bra start ;End do forever Output Compare Timers Each of 8 timer channels can be configured as input capture (from Port T) or output compare (to Port T), or Port T used for GP I/O as before if timers not used; choice via TIOS reg Output compare allows more accurate timing delays than the TOF Each of the 8 timer channels has a 6-bit timer capture/compare register (TCn: TC7 TC0), may be loaded or stored with 6-bit value Output Compare Timers TCn register compared with TCNT every clock cycle; when equal then flag for that channel (CnF: C7F C0F) is set; can poll this flag, or Timer Output Compare Hardware If interrupt enabled for that channel (CnI: C7I C0I) and I-bit in CCR unmasked, then OC interrupt occurs OC Time Delays Example: Use output compare to achieve ms delay (8000 cycles of 8MHz bus clock) ;Constant Equates ONE_MS: EQU 8000 ; Clocks per ms ;I/O Register Equates TIOS: EQU $80 ; Input Cap/Out Compare Select TSCR: EQU $86 ; Timer System Control TCNT: EQU $84 ; TCNT register TFLG: EQU $8E ; TFLG register TC: EQU $9 ; Timer channel CF: EQU %0000000 ;Output compare Flag TEN: EQU %0000000 ; Timer Enable OC Time Delays Example: Use output compare to achieve ms delay (8000 cycles of 8MHz bus clock) ; Enable the timer hardware bset TSCR,TEN ; Enable Output Compare Channel bset TIOS,CF ; Just generate a ms delay here ; Grab the value of the TCNT register ldd TCNT 5/6 addd #ONE_MS 4 std TC ; Now reset the flag and wait until it is set 5 ldaa #CF 4 staa TFLG ; Wait until the flag is set 6 spin: brclr TFLG,CF,spin

Changing the Timer Prescaler In last example, delay limited to 8.9ms when 8MHz bus clock used (5ns 64K) But, can divide TCNT increment of bus clock cycles using PR:PR:PR0 prescale bits For example: for generation of a 0ms delay Uses PR:PR:PR0 = 00 (i.e. 4) each clock pulse is 500ns delay = 500ns/cycle 0000 cycles = 0ms Changing the Timer Prescaler TMSK: EQU $8D ; Timer mask PR: EQU %0000000 ; Prescale bit PR: EQU %0000000 ; Prescale bit PR0: EQU %0000000 ; Prescale bit 0 ; Get the current prescaler value and save it ; to be restored later ldab TMSK pshb ; Set the prescaler to divide by 4 bclr TMSK,PR PR0 bset TMSK,PR... ; Now restore the original prescaler values pulb stab TMSK Changes to prescaler bits will affect whole timer system, so may wish to restore afterwards OC Interrupts Longer delays can also be generated by waiting for more output comparisons to be made Example: generating s delay using OC flag to generate interrupt Achieved by waiting 50 complete 4ms delay times (5ns/cycle 000 cycles = 4ms) generated by OC ~8ms for setup, interrupt occurs every 4ms, total 50 interrupts OC Time Delays Example: generating s delay using OC flag to generate interrupt OCVEC: EQU $FFEA; Timer channel interrupt vector ; Constant Equates NTIMES: EQU 50 ; Number of 4 ms delays D_4MS: EQU 000 ; Num clocks for 4 ms ; I/O Register Equates TIOS: EQU $80 ; In capt/out compare select TCNT: EQU $84 ; TCNT register TSCR: EQU $86 ; Timer control register TMSK: EQU $8C ; Timer mask reg TFLG: EQU $8E ; TFLG offset TC: EQU $94 ; Timer register TEN: EQU %0000000 ; Timer enable bit CF: EQU %0000000 ;Output compare Flag CI: EQU CF ; Interrupt enable IOS: EQU CF ; Select OC OC Time Delays Timer Output Compare Hardware ; Enable the timer system bset TSCR,TEN ; When out of the spin loop ; Enable output compare channel ; Reinitialize the counter bset TIOS,IOS ldaa #NTIMES ; Generate a s delay staa counter ; Need NTIMES interrupts ; DO SOME WORK HERE ldaa #NTIMES ; Return to wait for the next interrupt staa counter bra spin ; Grab the value of the TCNT register ldd TCNT ; Interrupt Service Routine std TC ; Decrement the counter ; Now have 8 ms to set up the system isr: dec counter ; Set up interrupts ; Set up TC for the next interrupt 6 4 ldaa #CF ldd TC staa TFLG ; Clear CF ; Add the clock pulses 5 bset TMSK,CI ; Enable TC Interrupt addd #D_4MS 7 cli ; Unmask global interrupts std TC ; Wait until the counter is 0 ; And clear the CF spin: wai ; Wait for interrupt ldaa #CF 8 tst counter staa TFLG bne spin rti /6/7 4/8 5 4

OC Bit Operation OC flags can auto. set or reset Port T bits when flag is set When successful OC occurs, one of fours actions may occur at output pin on Port T: disconnected, toggled, cleared, or set Selection made for each Port T output via OMn and OLn control bits in TCTL and TCTL regs OC Bit Operation Example: OM:OL = 0 to auto. toggle Port T- when OC occurs periodically Program outputs square wave w/ period of *OC delay (50% duty cycle) TCTL: EQU $89 OM: EQU %0000000 OL: EQU %0000000 ; Set up Output capture action to toggle the bit- bclr TCTL,OM bset TCTL,OL Input Capture Allows TCNT value latched when program-selected external event occurs via Port T e.g. period of pulse train found by storing TCNT at start of period (i.e. rising or falling edge), then capture count at end of period (next rising or falling edge), and take difference Input Capture Hardware Two bits for each IC channel, EDGnB (EDG7B EDG0B) and EDGnA control when signal on Port T causes capture to occur (i.e. rising, falling or both edges activate) IC interrupts operate just like OC interrupts Measure Waveform Period () bclr TIOS, %0000000 () bset TSCR, %000000 Pulse Accumulator Port T, bit7 can be configured as a PA input a system that "counts" events there are two operating modes ) "Event Counting Mode" - each time an edge occur on PT7, a 6-bit counter is incremented PT7 (6) ldd TC std First (9) ldd TC subd First (4)/(7) ldaa #%0000000 staa TFLG () ldaa #%0000000 staa TCTL4 (5)/(8) spin loop Counter 0 4 5 6 7 8 ) "Gated Accumulator Mode" - when PT7 is asserted, a 6-bit counter will increment based on the / 64 PT7 Counter 0 4 5 6 7 8 Bus Clk 64 5

Pulse Accumulator Operating Modes Pulse Accumulator PT7 Port Pin 'PACNT' 6-BIT Counter Event Counting Mode PAEN =, PAMOD = 0 PT7 Port Pin Divide by 64 'PACNT' 6-BIT Counter Gated Accumulator Mode PAEN =, PAMOD = May write to or read from PA at any time, again should do so via 6-bit load/store May select the edge (positive or negative) for event counting, or the level (high or low) for gated time accumulation, via several control bits Two flags and corresponding interrupts available: () PA overflow (PAOVF flag); and () selected input edge occurs (PAIF flag) e.g. sensor on conveyor belt counting products as they pass, it wants to take action after 4 counts initialize PA counter (PACNT) = -4, set up and use interrupt on PAOVG flag, and in ISR take appropriate action Pulse Accumulator Setup PACTL - "6-bit Pulse Accumulator Control Register" PAEN = PA System Enable Bit - PAEN = 0, disabled (default) - PAEN =, enabled PAMOD = PA Mode Select Bit - PAMOD = 0, Event Counter (default) - PAMOD =, Gated Accumulator PEDGE = PA Edge Control Bit - if (PAMOD = 0) "Event Counter" PEDGE = 0, PEDGE =, - if (PAMOD = ) "Gated Accumulator" PEDGE = 0, PEDGE =, Falling Edge Count (default) Rising Edge Count Active HIGH (default) Active LOW PA Flags - A flag is set upon PACNT Overflow (PAOVF) - A flag is set upon an input edge (PAIF) - PAFLG - "Pulse Accumulator Flag Register" PA Interrupts PA Flags & Interrupts - PAOVF =, event (reset by writing a '') - PAOVF = 0, no event - PAIF =, event (reset by writing a '') - PAIF = 0, no event - IRQs can be generated upon PACNT Overflow (PAOVI) - IRQ's can be generated upon an input edge (PAI) - PACTL - "Pulse Accumulator Control Register" - PAOVI = 0, disabled (default) - PAOVI =, enabled - PAI = 0, disabled (default) - PAI =, enabled Other Options for TCNT Clock Generator Two clock-select bits (CLK:CLK0) in PACTL reg. to select clock source for TCNT reg TCNT Clock Generator When PA disabled (PAEN=0), bus clock prescaled by PR:PR:PR0 bits as before Bus clock = 8MHz clock TCNT @8MHz (0:0:0) down to 8MHz/ = 50kHz (:0:) When PA enabled (PAEN=), TCNT source can be derived from either an event signal on PT-7 in EC mode (PAMOD=0) or bus clock further divided (PAMOD=) PAEN:CLK:CLK0 are used for TCNT clock mux selection 6

Real-Time Interrupt (RTI) RTI operates like TOF interrupt, except the periodic rate of generating interrupts is selectable Has its own vector in the vector table Enabled by RTIE bit, flag RTIF set at interval specified, and RTIF reset by as before RTI rate generated by a -bit counter that divides bus clock by = 89 or more via RTI prescalar bits (RTR:RTR0), where 000 = off, 00 =, 00 = 4,, = 9 Bus Clock Real-Time Interrupt (RTI) Bus clock = 8MHz intervals of 5ns =.04ms (00) up to 5ns 9 = 65.56ms () Bus clock = 4MHz intervals of 50ns =.048ms (00) up to 50ns 9 =.07ms () Real Time Interrupt (RTI) vs. Timer Overflow Interrupt Useful for slower Timer IRQ's than TOF This can be easier than counting many TOF's when looking for slower events External Interrupts using Timer Interrupts External inputs that generate timer interrupts may be used as GP vectored, external interrupts if pins are not o/w being used for I/O or timer functions PWM on B PWM (Pulse Width Modulator) module outputs up to 4 pulse-width modulated waveforms at once PT-7 (PA input edge or IC7 interrupt), PT-6 (IC6 interrupt),, PT-0 (IC0 interrupt), using enable bits (PAI, C7I,, C0I), flags (PAIF, C7F,, C0F), and vectors as before See Table 0.6 PWM Programming PWM Once initialized/enabled, outputs automatically with no further action from program Useful for many applications (e.g. controlling stepper motors) Programmable PERIOD and DUTY CYCLE t Duty Cycle = t DUTY PERIOD!00% PWM Port Pin t DUTY t PERIOD ) We program period in PWMPER register (s) - give in terms of clock cycles ) We program duty cycle in PWMDTY register (s) - can select 5%, 50%, 75% ) Can select Pulse Alignment - can select LEFT or CENTER 4) Can select Clock Input - / n 7

Example of PWM Waveforms Replicate PWM Concatenation PWM registers and counter may be concatenated in pairs for 6-bit timing resolution PWCNT and PWCNT together, PWCNT and PWCNT0 together Gives longer period and higher duty-cycle resolution Mirror May have four 8-bit, two 6-bit, or one 6-bit and two 8- bit PWM registers PWM Clock Control Four clock sources derived from bus clock: Clock A, Clock B, Clock S0, and Clock S Clocks A and B each may be produced as bus clock divided by,, 4,, 64, 8 PWM Clock Circuit Clocks S0 and S produced by further dividing A and B, respectively, by, 4, 6, 8,, 5 Example Question: What is the longest PWM period available assuming 8MHz bus clock and left-aligned waveform? Answer: Achieved by using concatenated PWPER register (6- bit) and slowest clock available (i.e. S0 or S): Bus clock period Clock A/B multiple of 8 Clock S0/S multiple of 5 max. # of counts = 5ns 8 5 64K = 56.87s 9 minutes! Timers we have studied ) Main Free Running Timer (TCNT) ) Timer Output Compare ) Timer Input Capture 4) Pulse Accumulator 5) Real Time Interrupt 6) Pulse Width Modulator Timer Summary What would best fit the following application? ) Count items on an assembly line ) Generate a 0/70 duty cycle to control a motor ) Measure phase of an incoming signal 4) Generate an edge every n seconds 5) Latch data from peripheral when an edge occurs 6) Generate interrupt every 50ms 8