25 R/F COnVeRTeR (RFC)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
25-7
(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.
Forced Termination
25.6.4
To abort reference oscillation or sensor oscillation, write 0 to SREF (reference oscillation), SSENA (sensor A oscil-
lation), or SSENB (sensor B oscillation) in the RFC_TRG register used to start the oscillation. The counters main-
tain the value at they stopped, note, however, that the conversion results cannot be guaranteed if the oscillation is
resumed. When resuming oscillation, initialize the counters.
Conversion error
25.6.5
Performing reference oscillation and sensor oscillation with the same resistor and capacitor results n
≈
m. The dif-
ference between n and m is a conversion error. The conversion error may be introduced caused by temperature,
voltage, and unevenness of IC quality, as well as external parts and on-board parasitic elements. For sample errors,
see “Electrical Characteristics.”
RFC interrupts
25.7
The RFC module includes a function for generating the following five different types of interrupts.
• Reference oscillation completion interrupt
• Sensor A oscillation completion interrupt
• Sensor B oscillation completion interrupt
• Measurement counter overflow error interrupt
• Time base counter overflow error interrupt
The RFC module outputs one interrupt signal shared by the five above interrupt causes to the interrupt controller
(ITC). Inspect the interrupt flag to determine the interrupt cause occurred.