PCM-3718 Series User Manual
34
4.4 MUX Scan Register -BASE+2
Read/write register BASE+2 controls multiplexer (MUX) scanning. The
high nibble provides the stop scan channel number, and the low nibble
provides the start scan channel number. The MUX initializes
automatically to the start channel when you write to this register. Each
A/D trigger sets the MUX to the next channel.
With continuous triggering, the MUX will scan from the start channel to
the end channel, and then repeat the process. For example, if the start
channel is 3 and the stop channel is 7, then the scan sequence is 3, 4, 5, 6,
7, 3, 4, 5, 6, 7, 3, 4 ...
CH3 to CH0
Stop scan channel number
CL3 to CL0
Start scan channel number
The MUX scan register low nibble, CL3 to CL0, also acts as a pointer
when you program the A/D input range (see previous section). When you
set the MUX start channel to N, the range code written to the register
BASE+1 is for channel N.
Programming example
This C code sets the range for channel 5 to ±0.625 V:
OUTPORTB (BASE+2, 5); /* SET POINTER TO CHANNEL 5*/
OUTPORTB (BASE+1, 3); /* RANGE CODE FOR ±0.625V*/
BASE+2 (write) - start and stop scan channels
Bit
D7
D6
D5
D4
D3
D2
D1
D0
Value
CH3
CH2
CH1
CH0
CL3
CL2
CL1
CL0
Note
The MUX start/stop channel changes each time
when you change the input range. Do not forget
to reset the MUX start and stop channels to the
correct values after your range setting.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com