16 R/F COnVeRTeR
16-4
Seiko epson Corporation
S1C63003/004/008/016 TeChniCal Manual
(Rev. 1.1)
Operation of R/F Conversion
16.4
Counter
The R/F converter incorporates two types of counters: measurement counter MC[19:0] and time base counter
TC[19:0]. The measurement counter is a 20-bit up counter that counts the CR oscillation clock with the reference
resistance or sensor selected by software. The R/F conversion results can be obtained by reading this counter. The
time base counter is a 20-bit up/down counter to equal both oscillation times for the reference resistance and the
sensor. The time base counter uses the R/F converter clock selected by the RFCKS[2:0] register. Each counter
permits reading and writing on a 4-bit basis.
First start an R/F conversion for the reference resistance. The measurement counter starts counting up and the
time base counter starts counting down. The counters stop counting when the measurement counter overflows
("FFFFFH"
→
"00000H"). By resetting the time base counter to "00000H" before starting an R/F conversion for
the reference resistance, the reference oscillation time will be obtained from the time base counter.
Then start an R/F conversion for the sensor, the measurement counter starts counting up from "00000H" and
the time base counter starts counting up from the counted value. The counters stop counting when the time base
counter overflows ("FFFFFH"
→
"00000H"). The oscillation time in this phase is the same as that of the reference
resistance.
Therefore, by converting an appropriate initial value for counting of the oscillation of the reference resistance
into a complement (value subtracted from "00000H") and setting it into the measurement counter before starting
to count, the number of counts for the sensor oscillation is obtained by reading the measurement counter after the
R/F conversion. In other words, the difference between the reference resistance and sensor oscillation frequencies
can be found easily. For instance, if resistance values of the reference resistance and the sensor are equivalent, the
same value as the initial value before converting into a complement will be obtained as the result.
The time base counter allows reading of the counter value and presetting of data. By saving the counter value after
the reference oscillation has completed into the RAM, the subsequent reference oscillation phase can be omitted.
The sensor oscillation can be started after setting the saved value to the time base counter and "00000H" to the
measurement counter.
Note: When setting the measurement counter or time base counter, always write 5 words of data continu-
ously in order from the lower address (FF62H
→
FF63H
→
FF64H
→
FF65H
→
FF66H, FF67H
→
FF68H
→
FF69H
→
FF6AH
→
FF6BH). Furthermore, an LD instruction should be used for writing
data to the measurement counter and a read-modify-write instruction (AND, OR, ADD, SUB, etc.)
cannot be used. If data other than low-order 4 bits is written, the counter cannot be set to the desired
value.
R/F conversion sequence
An R/F conversion for the reference resistance starts by writing "1" to the RFRUNR register.
However, an initial value must be set to the measurement counter and the time base counter must be cleared to
"00000H" before starting the R/F conversion.
When R/F conversion is initiated by the RFRUNR register, oscillation by the reference resistance begins, and the
measurement counter starts counting up from the initial value by the oscillation clock. The time base counter also
starts counting down by the R/F converter clock.
If the measurement counter becomes "00000H" due to overflow, the oscillation is terminated. At the same time
an interrupt occurs and the RFRUNR register is set to "0," and the R/F converter circuit stops operation com-
pletely.
The time base counter value should be saved into the RAM for R/F conversion of the sensor.
Figure 16.4.1 shows a timing chart for the reference oscillation.