BAT32G1x9 user manual | Chapter 15 A/D converter
522 / 1149
Rev.1.02
15.5.3 Hardware triggers the setting of wait mode
Figure15-34 Hardware triggers the setup of wait mode
configuration starts
configuration PER0
register
configuration PMC register
configuration ADM0 register
configuration ADM1 register
configuration ADM2 register
configuration ADTRG register
configuration ADNSMP register
configuration ADUL/ADLL register
configuration ADS register
(configure sequence not in specific
order
)
configuration ADCE bit
generate hardware trigger
power source stablization
wait cycles
A/D start conversion
set ADCEN bit of PER0 register to 1, start provide clock
configure port as analog input: configure via PMCx register
ADM0 register
FR2~FR0 bit: configure A/D conversion time.
ADM1 register
ADSCM bit: continous conversion / single conversion
ADMD bit: selection mode/Scan mode
ADTRG register
ADTMD1 bit, ADTMD0 bit: Configure as Hardware trigger wait
mode
ADTRS1 bit, ADTRS0 bit: select trigger source.
ADM2 register
ADREFP bit, ADREFM bit: Select reference voltage
ADRCK bit: select compare range of A/D conversion result which
generates interrupt signal
configure sampling time
ADUL/ADLL register
configure A/D conversion result comparision upper and lower limit
ADS register
select analog input channel
set ADCE bit of ADM0 register to 1, enter into hardware
trigger standby state.
hardware automatically wait for 1us for A/D power source
stablization.
based on ADRCK bit and ADUL/ADLL register configuration,
compare with result of A/D conversion, hardware will
automatically decide whether to generate A/D conversion
completion interrupt (INTAD).
A/D conversion in
progress
A/D conversion in progress
the conversion result will
be saved into ADCR
register
if A/D conversion interrupt (INTAD) is generated, the
conversion result will be saved into ADCR register. Otherwise,
the conversion result will not be saved into ADCR register.
hardware trigger
standby state
after A/D power source stablization wait time counting
completes, start A/D conversion.