A-D CONVERTER
7902 Group User’s Manual
13-17
13.6 One-shot mode
In the one-shot mode, the A-D conversion for an input voltage from one selected analog input pin is
performed once, and an A-D conversion interrupt request occurs at completion of A-D conversion.
13.6.1 Settings for one-shot mode
Figure 13.6.1 shows an initial setting example for related registers in the one-shot mode.
When using an interrupt, it is necessary to set the related registers to enable an interrupt. Refer to
“CHAPTER 7. INTERRUPTS” for more details.
Fig. 13.6.1 Initial setting example for related registers in one-shot mode
A-D control registers 0 and 1
b7
b0
A-D control register 0 (Address 1E16)
00
0
0 0 0 : AN0 selected
0 0 1 : AN1 selected
2 selected
0 1 1 : AN3 selected
b1b0
b2
Trigger select bit
0 : Internal trigger
1 : External trigger
A-D conversion start bit
0 : A-D conversion halts.
Analog input pin select bits
A-D conversion frequency (
φAD) select bit 0
See Table 13.2.1.
One-shot mode
b7
A-D control register 1 (Address 1F16)
X : It may be either “0” or “1.”
b0
!
0
Resolution select bit
0 : 8-bit resolution mode
1 : 10-bit resolution mode
A-D conversion frequency (
φAD) select bit 1
See Table 13.2.1.
External trigger polarity select bit
0 : Falling edge of pin ADTRG’s input signal
1 : Rising edge of pin ADTRG’s input signal
Note: Writing to the following must be performed during the A-D conversion halts (berore an trigger is generated).
Each bit of the A-D control register 0 (except bit 6)
Each bit of the A-D control register 1
Port P7 direction register
b7
b0
Port P7 direction register (Address 1116)
AN0
AN1
AN2
AN3
Interrupt priority level
b7
b0
A-D conversion interrupt control register
(Address 7016)
Interrupt priority level select bits
Set the level to one of 1 through 7 when using this
interrupt.
Set the level 0 when disabling interrupts.
Interrupt request bit
“0” : No interrupt requested
0
Clear the bits corresponding to analog input
pins to “0.”
Clear bit 7 to “0” when selecting an external
trigger.
Set A-D conversion start bit to “1.”
b7
b0
A-D control register 0
(Address 1E16)
A-D conversion start bit
1
Operation starts.
Trigger generated
Input an external trigger to
pin ADTRG (falling edge/
rising edge).
Selecting external trigger
Setting internal trigger
VREF connection select bit
0 : Pin VREF is connected.
0
1 0 0 : AN4 selected
1 0 1 : AN5 selected
1 1 0 : AN6 selected
1 1 1 : AN7 selected
AN4
AN5
AN6
AN7