
21 R/F CONVERTER (RFC)
21-6
Seiko Epson Corporation
S1C17705 TECHNICAL MANUAL
Conversion Operations
21.6
The conversion operations by the R/F converter should be controlled in the following procedure regardless of the
operating mode: initial settings, reference oscillation control, and sensor oscillation control. The R/F converter
channels are controlled individually and both channels cannot operate simultaneously. This section describes these
control procedure.
Although the following explanations assume that the internal oscillator circuit is used, the control procedures are
the same even in external clock input mode. When the R/F converter is used in external clock input mode, select
which oscillation is performed either reference or sensor and determine the counter initial values depending on the
purpose for using.
Initial Settings
21.6.1
Clock and pin configurations
(1) Select the R/F converter operating clock (TCCLK) and enable the clock supply. (See Section 21.3.)
(2) Configure the pins to be used for the R/F converter by switching from general-purpose input/output ports.
See the “I/O Ports (P)” chapter.
R/F converter channel and mode settings
(1) Set RFCEN/RFC_CTL register to 1 to enable the R/F converter.
(2) Select the channel to perform conversion using CHSEL/RFC_CTL register. Setting CHSEL to 0 (default)
selects Ch. 0 and setting 1 selects Ch.1.
(3) Set the oscillation mode using SMODE[1:0]/RFC_CTL register. (See Section 21.4.1.)
Reference Oscillation Control
21.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).
(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.
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 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.