
2.7.1 A/D conversion flow
Before using the A/D converter, the user should setup the following hardware items :
1. Selects internal trigger or external trigger (JP8)
2. Selects IRQ level if needed (JP5)
3. Selects DMA channel if needed (JP6, JP7)
4. Selects internal clock or external clock for counter0 if needed (JP9)
Then the user must decide which A/D conversion mode will be used. The software driver
supports three different modes:
polling, interrupt and DMA.
The user can control the A/D
conversion by polling mode very easy. It is recommended to use the software driver if using
interrupt or DMA mode.
The multiplexer can select one of the 16 single-ended channel and let external signal pass
into the gain control module. T
he settling time of multiplexer depends on the source
resistance.
Because the software
doesn’t take care the settling time
,
the user should
delay enough settling time if switching from one channel to next channel.
The gain control module also need settling time if gain control code changed. Because
the software
doesn’t take care the settling time
,
the user should delay enough settling
time if gain control code is changed.
The software driver provides
a machine independent timer, A-812PG_Delay()
, for
settling time delay. This subroutine assumes that JP6 select internal 2M clock and use
counter0 to implement a machine independent timer. If the user call A-812PG_delay(), the
counter0 will be reserved and can’t be used as a user programmable timer/counter.
The output of gain control module feed into the A/D converter.
The A/D converter
needs a trigger signal to start an A/D conversion cycle
. The A-812PG supports three
trigger mode,
software, pacer and external trigger
. The result of A/D conversion can be
transfer into CPU by three mode :
polling, interrupt and DMA
.
A-812PG Hardware Manual (Ver.1.2, Sep/2005, IPH-004-12) -----
28