25 R/F COnVeRTeR (RFC)
25-6
Seiko epson Corporation
S1C17624/604/622/602/621 TeChniCal Manual
Reference Oscillation Control
25.6.2
First, perform oscillation with the reference resistor/capacitor and obtain the time base counter value to perform
sensor oscillation for the same period of time.
(1) Set the initial value (0x0 - n) to MC[23:0]/RFC_MC(H/L) registers (measurement counter). (See Section 25.5.)
(2) Set 0x0 to TC[23:0]/RFC_TC(H/L) registers (time base counter).
(3) Reset the cause-of-interrupt flags OVTCIF and EREFIF in the RFC_IFLG register by writing 1.
(4) Set SREF/RFC_TRG register to 1 to start reference oscillation.
The CR oscillator circuit starts oscillating with the reference resistor/capacitor and outputs the clock to the
measurement counter. The measurement counter starts counting up using the CR oscillation clock from the
initial value that has been set. The time base counter starts counting up using TCCLK from 0x0.
notes: • In the S1C17602/621, after a value is set to TC[23:0], wait a time interval at least three TCCLK
cycles before starting oscillation.
• For restrictions and precautions on control bit settings, see the descriptions in the “Control
Register Details” section. The control bits may not be set to the desired values depending on
conditions.
(5) When the measurement counter or the time base counter overflows (0xffffff
→
0x0), SREF is reset to 0 and
the reference oscillation stops automatically.
(6-1) The measurement counter overflow sets EREFIF to 1 indicating that the reference oscillation has been termi-
nated normally. An interrupt can be generated at this point. Read the time base counter value (TC[23:0] = X)
and store it to the memory by the interrupt handler routine. When this interrupt is not used, perform the same
processing after checking if EREFIF has been set.
(6-2) The time base counter overflow sets OVTCIF to 1 indicating that the reference oscillation has been terminat-
ed abnormally. An interrupt can be generated at this point. Handle this error in the interrupt handler routine.
When this interrupt is not used, perform the same processing after checking if OVTCIF has been set.
Count n
Overflow
(normal termination)
EREFIF = 1, SREF = 0
Underflow
(normal termination)
ESEN
x
IF = 1, SSEN
x
= 0
Overflow
(abnormal termination)
OVMCIF = 1, SSEN
x
= 0
0x0
(set automatically by reference oscillation
or set via software)
Count value m1
Count value m2
Determine the value
detected by the sensor
using the measurement
counter values m1 and m2.
Varied depending
on environment
(set automatically by reference oscillation
or set via software)
Time
Overflow
(abnormal termination)
OVTCIF = 1, SREF = 0
Count (0x0 - n)
two's-complement
of value n
(set via software)
Count value Max.
(0xffffff)
Count value Min.
(0x0)
Measurement counter
Time base counter
(set via software)
0x0
Count value Max.
(0xffffff)
Count value Min.
(0x0)
Count Up
Count Up
Count Down
Count Up
Reference oscillation
period t
REF
Start of reference oscillation
SREF = 0
→
1
Start of sensor oscillation
SSEN
x
= 0
→
1
Sensor oscillation
period t
SEN
(= t
REF
)
6.2.1 Counter Operations During Reference/Sensor Oscillation
Figure 25.
Sensor Oscillation Control
25.6.3
Perform oscillation with the sensor for the period of time obtained by the time base counter in reference oscillation
and count the oscillation clock by the measurement counter.