
50
EPSON
S1C60N02 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (A/D Converter)
Note that correct measurement is impossible if an over-
flow occurs. 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 con-
sideration.
Convert the initial value into a complement (value sub-
tracted from 0000H) before setting it on the up-counter
C0–C15. Since the data output from the up-counter C0–
C15 after A/D 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.8.4.
Note -
Set the initial value of the up-counter C0–C15 taking into
account the measurable range and the overflow of the up/down
counter TC0–TC15.
-
If the up/down counter TC0–TC15 is measured after A/D
conversion, it may not indicate "0000H". This is not due to
incorrect timing in terminating A/D conversion but because the
counting down clock is input after the control signal is output to
the up-counter to terminate counting.
Fig. 4.8.4
Sequence of A/D conversion
Up-counter
(C0–C15)
(0000H-n)
(1) Set the initial value (0000H-n)
Count up
FFFFH
0
Count up
:
m
Up/down counter
(TC0–TC15)
0000H
Count up
:
x
Count down
0001H
0000H
(2) Start A/D conversion
(Set "1" on the ADRUN)
(3) Read the up-counter and process the m–n value acoording to the program
Setting by software
Set the complement of the initial
value n on the up-counter
Set "0000H" on the up /down
counter
Oscillation by
reference resistance
Switch CR oscillation when
the up-counter overflows and
shift the up/down counter to
the counting-down mode
When the value of the up/down
counter reaches 0000H, oscillation
and conting stops, and
an interruption occurs.
Oscillation by
sensor