S1C63666 TECHNICAL MANUAL
EPSON
113
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (R/f Converter)
4.15.3 Operation of R/f conversion
Counter
The R/f converter incorporates two types of counters: measurement counter MCxx and time base
counter TCxx. 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 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 OSC1 clock (Typ. 32.768 kHz) as the count clock. 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 (counter = 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 (counter = 00000H). The oscillation time in this phase is the
same as that of the reference resistance.
Therefore, by converting a proper initial value for counting of the oscillation of the reference resis-
tance 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, always write 5 words of data continuously in order from
the lower address (FF92H
→
FF93H
→
FF94H
→
FF95H
→
FF96H). Furthermore, an LD instruc-
tion should be used for writing data to the measurement counter and a read-modify-write instruc-
tion (AND, OR, ADD, SUB, etc.) cannot be used.
R/f conversion sequence
An R/f conversion for the reference resistance starts by writing "1" to the register RFRUNR.
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 OSC1 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 completely.
The time base counter value should be saved into the RAM for R/f conversion of the sensor.
Figure 4.15.3.1 shows a timing chart for the reference oscillation.
Содержание S1C63666
Страница 1: ...Technical Manual CMOS 4 BIT SINGLE CHIP MICROCOMPUTER S1C63666 Technical Hardware S1C63666 ...
Страница 4: ......
Страница 6: ......