Download Print this page

Renesas R8C/11 Application Note page 2

Hide thumbs Also See for R8C/11:

Advertisement

Adjusting the Frequency of the High-speed On-chip Oscillator Using a Commercial Frequency
3.2 Outline of the Program
The following shows how to adjust the oscillation frequency of the high-speed on-chip oscillator using a
commercial frequency.
Measure the commercial frequency with timer C that uses the high-speed on-chip oscillator as its count
source. Adjust the high-speed on-chip oscillator to 8 MHz by adjusting the HR1 register in such a way that
the measured value and the logical value match.
The logical value can be obtained by the equation given below.
Logical measurement value of timer C
Commercial
frequency
(after converted to
square wave)
Logical measurement value when adjusting the high-speed on-chip oscillator to 8 MHz
Figure 1. Measuring the Commercial Frequency
The adjustment rate of the HR1 register (difference in the oscillation period when the HR1 register is set to
00h and when it is set to 01h) is 1 ns. Table 1 shows the relationship between the set value of the HR1
register and the measured value of timer C in cases where when the HR1 register is set to "n" the oscillation
frequency can be adjusted to 8 MHz.
Table 1. HR1 Set Value and Timer C Measured Value
HR1 set
value
n-2
n-1
n
n+1
n+2
In this application note, timer C is used as divided-by-8, and the measured value is divided by 100 before
being compared with the logical value (166). When the measured value and the logical value match, the
oscillation frequency is in the range of 7.97 MHz (timer C measured value = 16600) to 8.02 MHz (timer C
measured value = 16699).
REJ05B0471-0100Z/Rev.1.00
=
Commercial frequency × Divide-by-N value of the high-speed on-chip oscillator
"H"
"L"
50Hz or 60Hz
Measured by timer C
Commercial
frequency
50Hz
60Hz
Oscillation of the high-speed
on-chip oscillator
Period
Frequency
123ns
8.13MHz
124ns
8.06MHz
125ns
8.00MHz
126ns
7.94MHz
127ns
7.87MHz
Expected frequency of the high-speed on-chip oscillator
Logical value
Not divided
Divided by 8
160000
20000
133333
16667
Timer C measured value (when
measuring 60 Hz)
Not divided
135501
134409
133333
132275
131234
July 2004
R8C/11, R8C/13 Group
Divided by 8
16938
16801
16667
16534
16404
Page 2 of 21

Advertisement

loading

This manual is also suitable for:

R8c/13