Advantech Carbon Monoxide Alarm PCI-1718 Series Manuel D’Utilisation

Page de 94
39
Chapter 4  
4.3.1 Software Trigger and Polling
1.
Set the input range for each A/D channel
2.
Set the input channel by specifying the MUX scan range
3.
Trigger the A/D conversion by writing to the A/D low byte register 
(BASE+0) with any value.
4.
Check for the end of the conversion by reading the A/D status reg-
ister (BASE+8) EOC bit.
5.
Read data from the A/D converter by reading the A/D data register 
(BASE+0 and BASE+1)
6.
Convert the binary A/D data to an integer.
MUX Scan
Channel Control &
A/D Range
Control
Set Software
Trigger and
Disable Generated
Interrupt
Software A/D
Trigger
Check EOC
Get Data
EOC=0
w Base+0 1H
w Base+0 2H
w Base+ 09H
w Base+ 00H
r Base+ 08H
r Base+ 00H
r Base+01H
More Data?
Yes
No
EOC!=0
Set Scan Channel