English
Language : 

R8C-3MT Datasheet, PDF (1/21 Pages) Renesas Technology Corp – Sample Program: 3-Minute Timer
R8C/Tiny Series
Sample Program: 3-Minute Timer
APPLICATION NOTE
1. Abstract
The 3-minute timer uses the following functions:
• Timer X (timer mode)
• Timer Z (programmable waveform generation mode)
2. Introduction
The example described in this application note is intended for use in the R8C/17 group of
microcomputers.
This program can also be used when operating other microcomputers within the R8C/Tiny, provided
they have the same SFR (Special Function Registers) as the R8C/17 microcomputers. However, since it
is possible that some functions of the R8C/Tiny series will have been altered for functional
enhancements, etc., please be sure to obtain the SFR header file from the Renesas Web site shown
below.
http://www.renesas.com/en/r8ctiny
Operation (1) The 3-minute timer has two separate modes:
• Standby mode
• 3-minute timer mode
After reset
SW4(INT0)
Key depressed
Standby mode
3-minute timer mode
SW1(CNTR0)
Key depressed
(2) After reset, the microcomputer goes to standby mode.
(3) If SW4 (INT0) is pressed during standby mode, the microcomputer goes to 3-minute timer
mode.
(4) In 3-minute timer mode, the microcomputer executes a 3-minute count operation.
(5) When the microcomputer has finished counting 3 minutes, it sounds a buzzer two times
and goes to standby mode. (Buzzer operation will be detailed later.)
(6) If SW1 (CNTR0) is pressed during 3-minute timer mode, the microcomputer goes to
standby mode.
(7) Key input is sampled at 10 ms intervals, and is confirmed to have been entered when
sampled low three times consecutively. (Chattering elimination)
(8) The key inputs SW4 (INT0) and SW1 (CNTR0) are active-low. (When low, the key is
pressed; when high, not pressed.)
(9) During 3-minute timer mode, the status is indicated by LEDs according to the passage of
time, as shown below.
LED indications for the passage of time:
LED1 (red)
2 minutes or more remaining time Off
1 minute or more remaining time
Off
Off
10 seconds or more remaining time
10 seconds or less remaining time Off
0 second remaining time (buzzer sounded) On
LED2 (green)
Off
Off
Off
Off
Off
LED3 (green)
On
Flashes every
500 ms
Flashes every
500 ms
Flashes every
250 ms
Off
LED4 (green)
On
Flashes every
500 ms
Off
Off
Off
REJ05B0272-0200Z/Rev.2.00
July 2004
Page 1 of 21