BAT32G1x9 user manual | Chapter 15 A/D converter
521 / 1149
Rev.1.02
15.5.2 The hardware triggers the setting of no wait mode
Figure15-33 Hardware triggers the setup of no wait mode
configuration starts
configure PER0 register
configure PMC register
configure ADM0 register
configure ADM1 register
configure ADM2 register
configure ADTRG register
configure ADNSMP register
configure ADUL/ADLL register
configure ADS register
(configure sequence not in
specific order
)
configure ADCE bit
power source stablization
wait cycles counting
configure ADCS bit
start A/D conversion via
hardware trigger.
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 zero wait
mode
ADTRS1 bit, ADTRS0 bit: select trigger source.
ADM2 register
ADREFP bit
、
ADREFM bit: Select reference voltage
ADRCKbit: select compare range of A/D conversion result which
generates interrupt signal
ADNSMP register
configure sampling time
ADUL/ADLL register
configure A/D conversion result comparision upper and lower limit
ADS register
select analog input channel
set ADCS bit of ADM0 register to 1, enter into hardware
trigger standby state.
counting power source stablization wait cycles (1us) via
software
set ADCS bit of ADM0 register to 1, enter into hardware
trigger standby state.
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 completes
save conversion result 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