
21 R/F CONVERTER (RFC)
S1C17705 TECHNICAL MANUAL
Seiko Epson Corporation
21-7
Count n
Overflow
(normal termination)
EREFIF = 1, SREF = 0
Underflow
(normal termination)
ESENxIF = 1, SSENx = 0
Overflow
(abnormal termination)
OVMCIF = 1, SSENx = 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 Down
Count Up
Reference oscillation
period tREF
Start of reference oscillation
SREF = 0
→ 1
Start of sensor oscillation
SSENx = 0
→ 1
Sensor oscillation
period tSEN (= tREF)
6.2.1 Counter Operations During Reference/Sensor Oscillation
Figure 21.
Sensor Oscillation Control
21.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.
(1) Initialize MC[23:0] (measurement counter) by writing 0x0. This can be omitted after a reference oscillation
has completed.
(2) Initialize TC[23:0] (time base counter) by writing the value (X) that has been counted in the time base counter
during reference oscillation. This can be omitted after a reference oscillation has completed.
(3) Reset the cause-of-interrupt flags OVMCIF, ESENBIF, and ESENAIF in the RFC_IFLG register by writing 1.
(4) Set SSENA/RFC_TRG register (for sensor A) or SSENB/RFC_TRG register (for sensor B) to 1 to start sensor
oscillation.
The CR oscillator circuit starts oscillating with the sensor and outputs the clock to the measurement counter.
The measurement counter starts counting up using the CR oscillation clock from 0x0. The time base counter
starts counting down using TCCLK from the initial value (X) that has been set.
Note: For restrictions and precautions on control bit settings, see the descriptions in the “Control Regis-
ter Details” section. The control bits may not be set to the desired values depending on conditions.
(5) When the time base counter reaches 0x0 or the measurement counter overflows (0xffffff
→ 0x0), SSENA or
SSENB is reset to 0 and the sensor oscillation stops automatically.
(6-1) The time base counter reached 0x0 sets ESENAIF (for sensor A) or ESENBIF (for sensor B) to 1 indicating
that the sensor oscillation has been terminated normally. An interrupt can be generated at this point. Read the
measurement counter value (MC[23:0] = m) and process the detection results by the interrupt handler routine.
When this interrupt is not used, perform the same processing after checking if ESENAIF or ESENBIF has
been set.
(6-2) The measurement counter overflow sets OVMCIF to 1 indicating that the sensor 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 OVMCIF has been set.