English
Language : 

4509 Datasheet, PDF (65/142 Pages) Renesas Technology Corp – SINGLE-CHIP 4-BIT CMOS MICROCOMPUTER
4509 Group
11 Prescaler
Stop prescaler counting and then execute the TABPS instruction
to read its data.
Stop prescaler counting and then execute the TPSAB instruction
to write data to prescaler.
12 Timer count source
Stop timer 1 or 2 counting to change its count source.
13 Reading the count value
Stop timer 1 or 2 counting and then execute the TAB1 or TAB2 in-
struction to read its data.
18 Watchdog timer
• The watchdog timer function is valid after system is released from
reset. When not using the watchdog timer function, execute the
DWDT instruction and the WRST instruction continuously, and
clear the WEF flag to “0” to stop the watchdog timer function.
• The contents of WDF1 flag and timer WDT are initialized at the
RAM back-up mode.
• When using the watchdog timer and the RAM back-up mode, ini-
tialize the WDF1 flag with the WRST instruction just before the
microcomputer enters the RAM back-up state.
Also, set the NOP instruction after the WRST instruction, for the
case when a skip is performed with the WRST instruction.
14 Writing to the timer
Stop timer 1 or 2 counting and then execute the T1AB, T1R1L,
T2AB or T2R2L instruction to write data to timer.
15 Writing to reload register
In order to write a data to the reload register R1H while the timer
1 is operating, execute the T1HAB instruction except a timing of
the timer 1 underflow.
In order to write a data to the reload register R2H while the timer
2 is operating, execute the T2HAB instruction except a timing of
the timer 2 underflow.
16 Prescaler, timer 1 and timer 2 count start timing and count time
when operation starts
Count starts from the first rising edge of the count source (2) after
prescaler and timer operations start (1).
Time to first underflow (3) is shorter (for up to 1 period of the count
source) than time among next underflow (4) by the timing to start
the timer and count source operations after count starts.
When selecting CNTR input as the count source of timer, timer
operates synchronizing with the count edge (falling edge or rising
edge) of CNTR input selected by software.
➁
Count source
Count source
(When falling edge of
CNTR input is selected)
Timer value 3 2 1 0 3 2 1 0 3 2
Timer underflow signal
➂
➃
➀ Timer start
Fig. 60 Timer count start timing and count time when operation starts
17 PWM signal (PWM1, PWM2)
If the timer 1 count stop timing and the timer 1 underflow timing
overlap during output of the PWM1 signal, a hazard may occur in
the PWM1 output waveform.
If the timer 2 count stop timing and the timer 2 underflow timing
overlap during output of the PWM2 signal, a hazard may occur in
the PWM2 output waveform.
19 Clock control
When the RC oscillation is used as the main clock f(XIN), execute
the CRCK instruction in the initial setting routine of program (ex-
ecuting it in address 0 in page 0 is recommended).
The oscillation circuit by the CRCK instruction can be selected
only once. When the CRCK instruction is not executed, the ce-
ramic oscillation is selected for the main clock f(XIN).
Also, when the MCU operates only by the on-chip oscillator with-
out using main clock f(XIN), connect XIN pin to Vss and leave XOUT
pin open, and do not execute the CRCK instruction.
In order to switch the operation source clock (f(RING)) or f(XIN)),
generate the oscillation stabilizing wait time by software first and
set the oscillation of the destination clock to be enabled.
Registers RG and MR are initialized when system returns from
RAM back-up mode.
However, the selected contents (CRCK instruction execution state)
of main clock (f(XIN)) oscillation circuit is retained.
20 On-chip oscillator
The clock frequency of the on-chip oscillator depends on the sup-
ply voltage and the operation temperature range.
Be careful that variable frequencies when designing application products.
Also, when considering the oscillation stabilize wait time for switch-
ing clock, be careful that the variable frequency of the on-chip
oscillator clock.
21 External clock
When the external clock is used for the main clock (f(XIN)), con-
nect the XIN pin to the clock source and leave XOUT pin open. Do
not execute the CRCK instruction in program.
Be careful that the maximum value of the oscillation frequency
when using the external clock differs from the value when using
the ceramic resonator (refer to the recommended operating condi-
tion).
Also, note that the RAM back-up mode (POF instruction) cannot
be used when using the external clock.
Rev.1.02 2006.12.22 page 65 of 140
REJ03B0147-0102