Download Print this page

Renesas R8C/11 Application Note page 8

Hide thumbs Also See for R8C/11:

Advertisement

Adjusting the Frequency of the High-speed On-chip Oscillator Using a Commercial Frequency
4.2.3
Initial Frequency Adjust Function
first_hz_adjut()
Set tcc0
Count source = f8
______
Select INT
______
Select INT
Set tcc1
No filter
Select capture
______
Clear INT
3 interrupt request
Yes
IR_INT3=0?
______
Clear INT
3 interrupt request
in_timerc0 = tm0
Yes
IR_INT3=0?
______
Clear INT
3 interrupt request
in_timerc1 = tm0
dat=in_timerc1-in_timerc0
in_timerc0 = in_timerc1
in_timerc0 = in_timerc1
dat = dat / 100
dat
Frequency adjustment
value write
write_ringadjust_data(hr1)
return
REJ05B0471-0100Z/Rev.1.00
3 rising edge
3 interrupt
Wait until the first high-going transition of the commercial
frequency input signal occurs.
No
Save the timer value synchronously with the rising edge of the commercial
frequency input signal.
No
Save the timer value synchronously with the rising edge of the commercial
frequency input signal.
Find the difference with the timer value that was previously saved on the rising edge
of the commercial frequency input signal to measure the period of the commercial
frequency.
dat=166
(matches with
logical value)
f_downflag = 1
f_upflag=1?
No
HR1 != 0x00?
HR1 = HR1 - 1
dat<166
(high-speed on-chip oscillator slower
than 8 MHz)
Yes
Does not match with logical value when
f_downflag and f_upflag = 1. The value
No
at that time is approximated to 8 MHz.
Frequency adjustment value write
write_ringadjust_data(hr1)
Yes
return
July 2004
R8C/11, R8C/13 Group
dat>166
(high-speed on-chip oscillator
faster than 8 MHz)
f_upflag = 1
Yes
f_downflag=1?
No
HR1 < 0x7f?
No
Yes
HR1 = HR1 + 1
Page 8 of 21

Advertisement

loading

This manual is also suitable for:

R8c/13