rej05b0426_m16cap| Application Note

rej05b0426_m16cap PDF

rej05b0426_m16cap| Application Note


APPLICATION NOTE M16C/80 Group
Long-Period Timers
1.0 Abstract
In this process, Timer A0 and Timer A1 are connected to make a 16-bit timer with a 16-bit prescaler. Use the following peripheral functions: Timer mode of timer A Event counter mode of timer A

2.0 Introduction
Specifications (1) Set timer A0 to timer mode, and set timer A1 to event counter mode. (2) Perform a count on count source f1 using timer A0 to count for 1 ms, and perform a count on timer A0 using timer A1 to count for 1 second. (3) Connect a 20-MHz oscillator to XIN. (4) The formula for calculating the Long-Period becomes as follows. (Long-Period) = (Count source period of Timer A0)x(Timer A0 register +1)x(Timer A1 register +1) Setting example for 1 sec period (1 sec) = (50ns)x(19999+1)x(999+1) Operation (1) Setting the count start flag to "1" causes the counter to begin counting. The counter of timer A0 performs a down count on count source f1. (2) If the counter of timer A0 underflows, the counter reloads the content of the reload register and continues counting. At this time, the timer A0 interrupt request bit goes to "1". The counter of timer A1 performs a down count on underflows in timer A0. (3) If the counter of timer A1 underflows, the counter reloads the content of the reload register and continue
s counting. At this time, the timer A1 interrupt request bit goes to "1". Figure 1 shows the operation timing.
l = reload register content

Timer A0 counter content (hex)

FFFF16 l

(1) Start count (2) Timer A0 underflow

(3) Timer A1 underflow

000016

Timer A1 counter content (hex)

Time n = reload register content FFFF16 n 000016 Set to "1" by software Cleard "0" by software Time "1" "0" Set to "1" by software "1" "0" Start count.

Timer A0 count start flag Timer A1 count start flag

Timer A0 interrupt "1" "0" request bit Cleared to "0" when interrupt request is accepted, or cleared by software Timer A1 interrupt "1" request bit "0"

Figure 1. Operation timing of long-period timers REJ05B0426-0100Z/Rev.1.00 March 2004 Page 1 of 8


rej05b0426_m16cap Application Note renesas Download PDF

Add this permalink to your bookmarks for future download of rej05b0426_m16cap ApplicationNote

Permalink: http://application.emcelettronica.com/renesas/rej05b0426_m16cap

PDF rej05b0426_m16cap APPLICATION NOTE