
S1C621C0 TECHNICAL MANUAL
EPSON
57
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (R/F Converter)
FFFEH FFFFH 0000H
n-2
n-1
n *
FFFDH
FFFCH
FFFBH
FFFAH
n-3
n-4
Time up
Interrupt is generated
fOSC1(3)
RFRUN register
RFIN
Time base counter clock
Time base counter
Measurement counter clock (RFOUT)
Measurement counter
Interrupt request signal
Count-up
*: Number of counts during sensor oscillation
Fig. 4.10.3.3 R/F conversion end timing
By the above operation, the sensor is oscillated for the same period of time as the reference resistance is
oscillated. Therefore, the difference in oscillation frequency can be measured from the values counted
by the measurement counter.
Since the reference resistance is oscillated until the measurement counter overflows, an appropriate
initial value needs to be set before R/F conversion is started. If a smaller initial value is set, a longer
counting period is possible, thereby ensuring more accurate detection. However, the time base counter
may overflow while counting the oscillation frequency of the reference resistance.
If an overflow occurs, CR oscillation and R/F conversion is terminated immediately. Also in such cases,
interrupt occurs. Moreover, the measurement counter may overflow while counting the sensor oscilla-
tion depending on initial value setting. If the measurement counter overflows, CR oscillation and R/F
conversion is terminated at that point and an interrupt occurs.
When these overflows occur, the correct value cannot be read. Therefore, the overflow flags are pro-
vided to judge whether the read data is correct or an overflow occurs. There are two overflow flags;
OVMC (D2HD2) that indicates an measurement counter overflow and OVTBC (D2HD3) that
indicates an time base counter overflow. These flags are set to "1" if respective counter overflows. These
flags are reset to "0" when R/F conversion is started or when "1" is written to the flag. When the inter-
rupt occurs, be sure to read the overflow flags and check overflow.
The initial value to be set depends on the measurable range by the sensor or where to set the reference
resistance value within that range.
The initial value must be set taking the above into consideration.
Convert the initial value into a complement (value subtracted from 0000H) before setting it on the
measurement counter. Since the data output from the measurement counter after R/F conversion
matches data detected by the sensor, process the difference between that value and the initial value
before it is converted into a complement according to the program and calculate the target value.
The above operations are shown in Figure 4.10.3.4.