2.6 10-Bit 8-Input Channel A/D Converter (with 8-bit Resolution Mode)
139
s Continuous Mode
In continuous mode the analog input signals selected by the ANS bits and ANE bits are converted in
order until the completion of conversion on the end channel determined by the ANE bits, then the
converter returns to the ANS channel for analog input and repeats the process continuously. If the start
channel and end channel are the same (ANS=ANE), then conversion will operate continuously on that
channel only.
Example 1.
ANS=000, ANE=011
Start → AN0 → AN1 → AN2 → AN3 → AN0 ... → repeat
Example 2.
ANS=010, ANE=010
Start → AN2 → AN2 → AN2 ... → repeat
In continuous mode, conversion is repeated until ‘0’ is written to the BUSY bit. Writing ‘0’ to the
BUSY bit forcibly stops the conversion operation.
Because forcibly stopping the operation requires the A/D converter to stop in the middle of a
conversion cycle, no values are obtained from the incomplete conversion cycle. The value in the ADCR
register will be the value of the last conversion cycle immediately before the stop.
q Continuous Mode: Sample I2OS Startup
Complete conversion of analog input on channels AN3 to AN5, obtain 2 cycles of conversion data
from each channel.
Transfer data in order to address 600H to 60BH
Startup at external signal edge
Highest priority interrupt level
I2OS Settings
Set ICR in interrupt controller
MOV ICR10,#08H................................................................................................ (1)
Set I2OS descriptors
MOV BAPL,#00H ............................................................................................... (2)
MOV BAPM,#06H .............................................................................................. (3)
MOV BAPH,#00H............................................................................................... (4)
MOV ISCS,#18H................................................................................................. (5)
MOV IOAL,#2EH ............................................................................................... (6)
MOV IOAH,#00H ............................................................................................... (6)
MOV DCTL,#06H............................................................................................... (7)
MOV DCTH,#00H .............................................................................................. (7)
Set A/D converter
MOV ADCS0,#9DH............................................................................................ (8)
MOV ADCS1,#A4H............................................................................................ (9)
Other processing
I2OS end interrupt sequence
MOV ADCS1,#80H........................................................................................... (10)
RETI
...