S1C62920 TECHNICAL MANUAL
EPSON
47
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (R/F Converter)
Measuremant counter
(MC)
(0000H-n)
(1) Set the initial value
(0000H-n)
Count up
FFFFH
0
Count up
:
m
Time base counter
0000H
Count down
:
x
FFFFH
0000H
(2) Start R/F conversion
(Set RFRUN to "1")
(3) Read the measurement counter and process the m - n value by the program
Setting by software
Set the complement of
the initial value n on the
measurement counter.
Oscillation by
reference resistance
Switch CR oscillation when
the measurement counter
overflows and shift the time
base counter to the count-up mode.
When the value of the time base
counter reaches "0000H",
oscillation and counting stop,
and an interrupt occurs.
Oscillation by
sensor
Count up
Fig. 4.10.3.4 Sequence of R/F conversion
Note: Set the initial value of the measurement counter taking into account the measurable range and the
overflow of counters.
(3) Operation mode
Thus far we explained the R/F converter to be operated in the normal mode.
The debug mode is set as an operating mode for the R/F converter in addition to the normal mode, and
can be set by writing "1" to the register RFDBG (D0HD2). To return to the normal mode, write "0" to
the RFDBG.
The debug mode is provided for hardware/software debugging. It functions to continuously oscillate
only the reference resistance side or sensor side. This function can measure the oscillation frequency by
the resisters connected to each terminal. (Overflow of each counter and interrupt do not occur.) Sensor
selection function is valid even in the debug mode. The oscillating operation starts by writing "1" to the
RFRUN and is continued until "0" is written to the RFRUN.
Whether to oscillate the reference resistance or sensor is selected using the register DBGOS (D0HD3).
When "1" is written to the DBGOS register, the sensor side is selected. When "0" is written, the reference
resister side is selected. This setting is valid only in the debug mode.
4.10.4 Interrupt function
The R/F converter has a function which allows interrupt to occur after R/F conversion.
When the time base counter is counted up to "0000H", both counters stop counting. The interrupt factor flag
IRF (F9HD0) is set to "1" at the rising edge of the next clock (OSC1 or OSC3 clock that has been selected as
the time base counter input clock).
If the time base counter overflows during counting of the reference resistance oscillation, or the measure-
ment counter overflows during counting of the sensor oscillation, the interrupt factor flag IRF is also set to
"1".
This interrupt factor allows masking by the interrupt mask register EIRF (F1HD0). When the EIRF has
been set at "1", an interrupt occurs in the CPU. When the EIRF is set at "0", no interrupt will occur in the
CPU even if the interrupt factor flag is set to "1".
The interrupt factor flag is reset to "0" by reading.
Timing of interrupt by the R/F converter is shown in Figure 4.10.4.1.