© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.

Slides:



Advertisements
Similar presentations
ECE/CS-352: Embedded Microcontroller Systems The Silicon Laboratories C8051F020 Enhanced 8051 Part 5 Other Subsystems.
Advertisements

More fun with Timer/Counters
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
Introduction of Holtek HT-46 series MCU
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.
5-1 Timer/Counters In many microprocessor systems we need to:  count logic pulses  measure the frequency of signals  measure the period of pulses 
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Lecture 9 Timer Operations and Programming. 2  Introduction  Summary of timers  Timer programming sequence  Summary of timer SFRs  Timer 0: 8-bit.
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.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 Clock Generator.
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)
ARM Timers.
System Clocks.
16F877A. Timer 0 The Timer0 module timer/counter has the following features: –8-bit timer/counter –Readable and writable –8-bit software programmable.
MS_uC / fue1 / V TIMx - Timer Programming Microcontroller TIMx - Timer Autumn term 2012.
Timers ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Chapter 4 TIMER OPERATION
CoE3DJ4 Digital Systems Design Chapter 4: Timer operation.
Timers The timers of the PIC16C7X microcontroller can be briefly described in only one sentence. There are three completely independent timers/counters.
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.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the CPU architecture.
Lecture 11 Low Power Modes & Watchdog Timers
RX Voltage Detection Circuit (LVD) and Power-On Reset (POR)
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose This course provides an overview of the peripheral functions.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides an overview of the CPU architecture.
1 68HC11 Timer Chapter HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output.
MCS51 - lecture 6. Lecture 6 1/32 Extending MCS51 system Built-in peripherals MCS51 family.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Module Introduction Purpose  This training module provides an overview of the analog interfaces.
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This course provides an detailed overview of the many R8C MCU product variations.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose This course provides an overview of the standard peripheral.
8254 Timer.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the Digital-to-Analog.
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.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the PWM type Digital-to-Analog.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
8051 Aula 02 Prof Afonso Ferreira Miguel. Microcontrolador 8051 (MCS-51)  Timers do MCS51 Two 16-bit Counter/Timers: Two 16-bit Counter/Timers: Up counters,
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
#1 of 10 Tutorial Introduction PURPOSE -To explain how to configure and use the Timer Interface Module in common applications OBJECTIVES: -Identify the.
Special Features. Device Configuration bits Revision Device Configuration bits Revision On-chip Power-on Reset (POR) Revision On-chip Power-on Reset (POR)
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 AD converter.
Timer modules in PIC 16F877.  The PIC 16F877 basically has three independent timer modules,  denoted by the symbols, TIMER-0, TIMER1,andTIMER2. . These.
16F877A.
Why are Timer Functions Important?
V.V.P. ENGINEERING COLLEGE,RAJKOT
ECE 3430 – Intro to Microcomputer Systems
Timer and Interrupts.
RX Watchdog Timer (WDT)
MSP432 ARM Timer Programming
RX Compare Match Timer (CMT)
RX 8-Bit Timer (TMR) 4/20/2011 Rev. 1.00
Introduction to Micro Controllers & Embedded System Design Timer Operation Department of Electrical & Computer Engineering Missouri University of Science.
8254 Timer and Counter (8254 IC).
Timer.
8051 Timers / Counters It has two timers Timer 0 and Timer 1.
Programmable Interval timer 8253 / 8254
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN
Timer Source: under
PIC18 Timer Programming “Explain the assembly language programming for the timer and counter module”
Programmable Interval timer 8253 / 8254
Lecture 12 Multi-Function Timer Pulse Unit 2 (MTU2a)
Timer Source: under
Presentation transcript:

© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions built into R8C Tiny series microcontrollers (MCUs).  Objective  Learn about the features and operation of the TimerRA, TimerRB, TimerRC, TimerRD and TimerRE functions.  Understand the basics of the Watchdog Timer.  Discover how the Power-on Reset (POR) and Low-Voltage Detect (LVD) functions operate.  Content  33 pages  5 questions  Learning Time  35 minutes

© 2009, Renesas Technology America, Inc., All Rights Reserved 2 Versatile Set of Timers The Watchdog Timer is covered separately in this course.

© 2009, Renesas Technology America, Inc., All Rights Reserved 4 Timer RA

© 2009, Renesas Technology America, Inc., All Rights Reserved 5 Timer RB

© 2009, Renesas Technology America, Inc., All Rights Reserved 6 Timer RC

© 2009, Renesas Technology America, Inc., All Rights Reserved 7 Timer RD

© 2009, Renesas Technology America, Inc., All Rights Reserved 8 Timer RE

© 2009, Renesas Technology America, Inc., All Rights Reserved 9 FF Timer Mode FF Reload register FF Count Start flag TRAPRE Pre-scalerTRA Counter Timer RA Interrupt f2 fOCO f8 f1 Count Source The timer counts an internally generated count source.  Operation:When the timer underflows, it reloads the register contents before continuing to count h Timer RA Mode register Timer RA Mode Register is used to put Timer RA into the Timer Mode and start/stop the counting. 08h 0 12 Example: Timer RA

© 2009, Renesas Technology America, Inc., All Rights Reserved 10 Pulse Output Mode 1 Reload register Count Start flag TRAPRE Pre-scalerTRA Counter f2 fOCO f8 f1 Count Source 1 Toggle flip-flop Q Q CK 01 TMOD bits The timer counts an internally generated count source, the TRAO pin outputs a pulse whose polarity is inverted when the timer underflows.  Operation:When the timer underflows, it reloads the register contents before continuing to count. TRAO 1 Example: Timer RA

© 2009, Renesas Technology America, Inc., All Rights Reserved 11 Pulse Output Mode: Timer RA Example 1 Reload Register Count Start Flag PREX registerTX register f2 fOCO f8 f1 Count Source 1 Toggle flip-flop Q Q CK 01 TMOD bits The timer counts an internally generated count source, the TRAO pin outputs a pulse whose polarity is inverted when the timer underflows.  Operation:When the timer underflows, it reloads the register contents before continuing to count. CNTR0 1

© 2009, Renesas Technology America, Inc., All Rights Reserved 13 Generate Complementary Outputs 1 Reload register Count Start flag TRAPRE Pre-scalerTRA Counter f2 fOCO f8 f1 Count Source 1 Toggle flip-flop Q Q CK 01 TMOD bits 1 TRAIO TRAO TRAIO has the option to be a port pin or an inverted output of TRAO 1 Example: Timer RA

© 2009, Renesas Technology America, Inc., All Rights Reserved 14 Event Counter Mode FF Reload register FF 0 Count Start Flag TRAPRE Pre-scalerTRA Counter External Count Source 1 TRAIO Timer RA Mode register 00h02h Ah 102 Timer RA Interrupt Example: Timer RA The timer counts an external signal fed to TRAIO pin.  Operation: When the timer underflows, it reloads the register contents before continuing to count. Timer RA Mode Register is use to put Timer RA into Event Counter Mode, selects the active edge of the count Source, and starts/stops the counter.

© 2009, Renesas Technology America, Inc., All Rights Reserved 15 Pulse Width Measurement Mode 0 Reload register Count Start flag TRAPRE Pre-scalerTRA Counter f2 f32 f8 f1 1 TRAIO Timer RA Interrupt TRAIO pin IR bit in TRAIC register Count Stop The timer measures the pulse width of an external signal fed into the TRAIO pin. TUNDF bit in TRACR register Timer Underflow Count Source Example: Timer RA

© 2009, Renesas Technology America, Inc., All Rights Reserved 16 Pulse Period Measurement Mode: Timer RA TRAIO pin Underflow signal of prescaler TRA contents 0F0E0D0F0E0D0C0B0A090F0E 0F0E0D Timer RA interrupt Timer RA active Edge detected ( TEGDF bit) 0B0A F 000F Timer RA underflow (TUNDF bit) Contents of read out buffer Timer RA reloads Timer RA read Cleared to “0” by program Period being measured Timer RA reloads

© 2009, Renesas Technology America, Inc., All Rights Reserved 17 Programmable Waveform Gen. Mode FF Reload registerTRBSC register FF 1 0 Count Start flag TRBPRE Pre-scalerTimer RB Counter f2 TRA UNF f8 f1 Count Source 1 Toggle flip-flop Q Q CK 01 TMOD bits FF TRBPR register TRBO P3_1 bit FF Primary period Secondary period A signal is output from the TRBO pin which is inverted each time the counter underflows, it reloads the contents of primary reload register and secondary reload register alternately before continuing to count Example: Timer RB

© 2009, Renesas Technology America, Inc., All Rights Reserved 18 Programmable One-Shot Gen. Mode 0 Reload register Count Start flag TRBPRE Pre-scalerTimer RB Counter f2 TRA UDF f8 f1 Count Source 1 Toggle flip-flop Q Q CK 01 TMOD bits TRBPR register TRBO P3_2 bit Digital Filter Input polarity selected to be one edge or both edges Polarity select TSTART TOSSTF TMODx INT0ENINT0PL INT0 Example: Timer RB

© 2009, Renesas Technology America, Inc., All Rights Reserved 19 Generating a Precise Pulse Width Contents of TRA TSTART bit in TRACR register Output of TRAO out pin Pre-scaler RA underflow signal Count Source IR bit in TRAIC register Count Starts Waveform Output Starts Waveform Output ends Timer RA primary reloads Set to “1” by program Set to “0” by program

© 2009, Renesas Technology America, Inc., All Rights Reserved 20 Programmable Wait One Shot Generation Mode: Timer RB In this mode, upon program or external trigger input, the device outputs the one-shot pulse from the TRBO pin after waiting for a given length of time. When a trigger occurs, the timer starts outputting a pulse for a given length of time equal to the set value in the TRBSC register. This is only after waiting for the TRBPR register to overflow Count Source Timer RB One Shot bit Contents of TRBPR Prescaler RB underflow signal Interrupt Request bit in Timer RB Interrupt Control register TRBO out pin Set to “1” by program, or set to “1” by INT0 pin input trigger Set to “0” when counting completed Count Starts Timer RB secondary reloads Timer RB primary reloads Waveform output starts Waveform output end Wait starts

© 2009, Renesas Technology America, Inc., All Rights Reserved 22 Input Capture Mode

© 2009, Renesas Technology America, Inc., All Rights Reserved 23 TimerRC Timer Mode Output Compare

© 2009, Renesas Technology America, Inc., All Rights Reserved 24 TimerRC PWM Mode

© 2009, Renesas Technology America, Inc., All Rights Reserved 25 TimerRD Complementary PWM Mode

© 2009, Renesas Technology America, Inc., All Rights Reserved 26 TimerRD Complementary PWM Mode

© 2009, Renesas Technology America, Inc., All Rights Reserved 28 Watchdog Timer 1/16 1/128 Watchdog Timer Interrupt Request Watchdog Timer Reset PM12 = 0 PM12 = 1 WDC7 = 0 WDC7 = 1 Set to 7FFF 16 Write to WDTS register RESET CPU Clock Pre-scaler Watchdog Timer The WDT circuit contains a 15-bit counter that counts down the clock derived by dividing the CPU clock by 16 or 128 using the pre-scaler.

© 2009, Renesas Technology America, Inc., All Rights Reserved 29 Power-On Reset Function CPU Res et IC CPU Res et IC Reset CCT No External Reset IC required 0.5 Vdet 5.0 time Internal state in Reset CPU ResetReset Released (1/f(RING)) X 32 Vdet = 3.8V ± 0.5V More Than 1ms VCC [V] S R Q 5-bit counter Internal RESET signal RESET fRING-S VCC > Vdet detection trigger 5KΩ

© 2009, Renesas Technology America, Inc., All Rights Reserved 30 Low Voltage Detect Function 2.7 Vdet 5.0 time Internal state in Reset CPU Reset Reset Released (1/f(RING)) X 32 Vdet = 3.8V ± 0.5V VCC [V] Reset Released The operation of the LVD function is essentially the same as the operation of the POR.

© 2009, Renesas Technology America, Inc., All Rights Reserved 31 LVD Operation Voltage Detect Enable 5.0 V Vdet Sampling time 3 to 4 clocks (1/f(RING)) X 32 Internal Reset Signal Voltage Detect Flag Voltage Detect Interrupt Request Sampling time 3 to 4 clocks VCC Interrupt Acknowledge 5.0 V

© 2009, Renesas Technology America, Inc., All Rights Reserved 33  Timer functions  Timer modes  Watchdog timer  Power-On Reset function  Low Voltage Detect function Course Summary