114
EPSON
S1C63656 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (R/f Converter)
The RFRUNS register is set to "0" at the falling edge of the input clock immediately after the time base
counter reaches 00000H. Interrupt conditions are sampled with the OSC1 clock, so an interrupt occurs
in synchronization with the rising edge of the OSC1 clock immediately after the RFRUNS register is
set to "0".
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, an interrupt occurs. Moreover, the measurement counter may overflow while counting the
sensor oscillation 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
provided to judge whether the read data is correct or an overflow occurs. There are two overflow
flags; OVMC that indicates an measurement counter overflow and OVTBC 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 interrupt 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 00000H) 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.14.3.3.
Measurement counter
(MC)
(00000H-n)
(1) Set the initial value
00000H-n
00000H
Count up
FFFFH
0
0
Count up
:
m
Time base counter
(TC)
00000H
Count down
:
x
x
FFFFH
00000H
(2) Start reference oscillation
(Set RFRUNR 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.
Set 00000H on the time base counter.
(Set 00000H on the measurement counter.
Set x on the time base counter.)
Oscillation by
reference resistance
The CR oscillation stops when
the measurement counter overflows
and an interrupt occurs. Save the TC value
into the memory.
When the value of the time base
counter reaches 00000H,
oscillation and counting stop,
and an interrupt occurs.
Oscillation by
sensor
Count up
Reference oscillation
(1) Set the initial value
(00000H)
(x)
(2) Start sensor oscillation
(Set RFRUNS to "1")
Sensor oscillation
Fig. 4.14.3.3 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.
Содержание S1C63656
Страница 1: ...Technical Manual CMOS 4 BIT SINGLE CHIP MICROCOMPUTER S1C63656 Technical Hardware S1C63656 ...
Страница 4: ......
Страница 6: ......