XC886/888CLM
Analog-to-Digital Converter
User’s Manual
16-28
V1.3, 2010-02
ADC, V 1.0
16.5
ADC Module Initialization Sequence
The following steps is meant to provide a general guideline on how to initialize the ADC
module. Some steps may be varied or omitted depending on the application
requirements:
•
Configure global control functions:
– Select conversion width (GLOBCTR.DW)
– Select analog clock
f
ADCI
divider ratio (GLOBCTR.CTC)
•
Configure arbitration control functions:
– Select priority level for request source x (PRAR.PRIOx)
– Select conversion start mode for request source x (PRAR.CSMx)
– Enable arbitration slot x (PRAR.ASENx)
– Select arbitration mode (PRAR.ARBM)
•
Configure channel control information:
– Select limit check control for channel x (CHCTRx.LCC)
– Select target result register for channel x (CHCTRx.RESRSEL)
– Select sample time for all channels (INPCR0.STC)
•
Configure result control information:
– Enable/disable data reduction for result register x (RCRx.DRCTR)
– Enable/disable event interrupt for result register x (RCRx.IEN)
– Enable/disable wait-for-read mode for result register x (RCRx.WFR)
– Enable/disable valid flag reset by read access for result register x (RCRx.VFCTR)
•
Configure interrupt control functions:
– Select channel x interrupt node pointer (CHINPR.CHINPx)
– Select event x interrupt node pointer (EVINPR.EVINPx)
•
Configure limit check boundaries:
– Select limit check boundaries for all channels (LCBR.BOUND0, LCBR.BOUND1)
•
Configure external trigger control functions:
– Select source x external trigger input (ETRCR.ETRSELx)
– Enable/disable source x external trigger input synchronization (ETRCR.SYNENx)
•
Setup sequential source:
– Enable conversion request (QMR0.ENGT)
– Enable/disable external trigger (QMR0.ENTR)
•
Setup parallel source:
– Enable conversion request (CRMR1.ENGT)
– Enable/disable external trigger (CRMR1.ENTR)
– Enable/disable source interrupt (CRMR1.ENSI)
– Enable/disable autoscan (CRMR1.SCAN)
•
Turn on analog part:
– Set GLOBCTR.ANON (wait for 100 ns)
•
Start sequential request:
– Write to QINR0 (with information such as REQCHNR, RF, ENSI and EXTR)
*