25 RF Converters (RFC)
25-6
EPSON
S1C17602 TECHNICAL MANUAL
25.4 Conversion Operations
Conversion operations of the R/F converter are performed by following sequence of Initial settings
→ Reference
oscillation
→ Sensor oscillation for each channel irrespective of operation mode. The sequence is shown below.
Initial Settings
(1) Select TCCLK frequency which is the counter clock of the time base counter. Refer to “7.9 RFC Clock
Control”
(2) Enable TCCLK. Refer to “7.9 RFC Clock Control”.
(3) Enable the port to be used by the R/F converter. Refer to “10.2 Input/Output Pin Function Selection (Port
MUX)”.
Note: Enable TCCLK and then set the R/F converter. R/F converter does not operate normally, if
TCCLK is not provided
Mode settings of the R/F converter
(1) Set RFCEN register =1 and enable R/F converter.
(2) Select the channel in which the conversion is to be executed by using CHSEL register.
(3) Set the conversion mode by using SMODE register.
RFCEN : RFC Enable Bit in the RFC Control (RFC_CTL) Register (D0/0x53a0)
CHSEL : Conversion Channel Select in the RFC Control (RFC_CTL) Register (D1/0x53a0)
SMODE : Sensor Oscillation Mode Select in the RFC Control (RFC_CTL) Register (04-5/0x53a0)
Settings and conversion of reference oscillation
(1) Set the initial value to MC23-0 register (Measurement Counter). As the measurement counter is up counter,
set complement 2 (0x000000-n) value of the value n to be counted.
(2) Initialize the value of TC23-0 register (Time base counter) to 0x000000.
(3) Write 1 in OVTCIF and EREFIF register and clear interrupt flag.
Note: Oscillation cannot be started if the interrupt flag register is not cleared.
(4) Set SREF register to 1 and start the reference oscillation.
Note: First set the value to TC23-0, and wait for the time corresponding to a TCCLK3 cycle, and
then start oscillation.
For precautions on register settings, refer to details on control registers to prevent
incorrect setting of the value.
(5) When the “Measurement counter” or “Time base counter” are overflowed, SREF register turns to 0 and
reference oscillation ends automatically.
(6-1) When the measurement counter overflows, EREFIF register is set to 1 with normal exit. Save this Value x
of Time base counter.
(6-2) When the time base counter overflows, OVTCIF register set to 1 with error.
MC23-0 : Measurement Counter Data D23-0 in the RFC Measurement Counter Data (RFC_MC) Register
(D23-0/0x53a4/0x53a6)
TC23-0 : Time Base Counter Data D23-0 in the RFC Time Base Counter Data (RFC_TC) Register (D23-
0/0x53a8/0x53aa)
SREF : Reference Oscillation Start Trigger in the RFC Oscillation Start (RFC_TRG) Register (00/0x53a2)
OVTCIF : Time Base Counter Over Flow Error Int Enable in the RFC Interrupt Mask (RFC_IMSK) Register
(D4/0x53ac)
EREFIF : Reference Oscillation End Flag in the RFC Interrupt Flag (RFC_IGLG) Register (D0I0x53ae)