
How to Use A/D Converter for S6J3110/ S6J3120 Series
Document No. 002-04457 Rev. *B
2
3
Overview
This section explains an overview of the 12-bit A/D converter.
The 12-bit A/D converter has the function of converting analog input voltage into a 12-bit digital value by RC
successive approximation conversion system. And this section explains the range comparison function. Range
comparison function detects digital value of inside and outside by upper and lower threshold registers settings.
3.1
A/D Compare Activation
The function of A/D activation compare is explained.
3 . 1 . 1
An a l o g I n p u t C o n t r o l
This A/D converter includes 2 converter units, and can enable or disable each of up to 64 channels of analog input.
3 . 1 . 2
A c t i v a t i o n C h a n n e l
It performs operation for A/D activation request control and A/D conversion data storage with each activation channel.
The A/D activation channel corresponds to each unit of 12-bit A/D converter. The correspondence is as follows.
Activation channels 0-31: 12-bit A/D converter unit 0
Activation channels 32-63: 12-bit A/D converter unit 1
3 . 1 . 3
A/ D Ac t i v a t i o n R e q u e s t
Each activation channel issues an A/D activation request by one of the following methods.
Software
Base timer (Reload timer, PWM timer compare match)
Free-run timer compare match
For software activation, reload timer activation, and PWM timer activation, an arbitrary activation channel can be
selected. For compare match activation, the A/D activation is requested when the value in the free-run timer and the
compare register of each activation channel match.
For an activation request, either single mode or repeat mode can be set for each activation channel.
In single
mode, an activation factor causes an activation request. In repeat mode, an activation factor causes
a continuous
activation request.
3 . 1 . 4
A/ D C o n ve r s i o n D a t a
When A/D conversion is completed, the converted data is stored in the A/D data register. Each activation channel is
equipped with an A/D data register. Each A/D data register contains an error flag bit and error status bit. The status of
the A/D-converted data can be learned from the values of these bits.
3 . 1 . 5
S c a n C o n v e r s i o n w i t h t h e A/ D C o n ve r s i o n C o u n t S p e c i f i e d
Scan conversion with the A/D conversion count specified can be performed for each activation channel.
1 type of scan conversion with the A/D conversion count specified can be specified for each 12-bit A/D converter unit.
As the specification of an A/D conversion count, a number from 1 to 4 can be selected.
3 . 1 . 6
R a n g e C o m p a r i s o n F u n c t i o n
The range comparison can be compared for each activation channel.
Up to 4 types of upper and lower threshold settings can be made. Each activation channel selects 1 combination
from among the 4 types.
Inside or Outside detection can select in the upper and lower thresholds.
Continuous detection count function. (Detection count can select from 1 to 7.)
3 . 1 . 7
I n t e r r u p t R e q u e s t
Each activation channel can generate an interrupt request when the A/D conversion is completed.
3 . 1 . 8
D a t a P r o t e c t i o n F u n c t i o n
For each A/D data register, the data protection function can be set. The protection function is effective for factors that
are not compare match activation. When the data protection function is enabled, the A/D activation request is masked
until data is read from the A/D data register and the interrupt flag is cleared.