Toshiba TLCS-900 Computer Hardware User Manual


 
TMP92CM22
2007-02-16
92CM22-210
Example:
1. Convert the analog input voltage on the AN3 pin and write the result, to memory
address 0800H using the AD interrupt (INTAD) processing routine.
Setting of main routine
7 6 543210
INTE0AD X 1 0 0
Enable INTAD and set it to interrupt level 4.
ADMOD1 1 1 000011 Set pin AN3 to the analog input channel.
ADMOD0 X X 000001 Start conversion in channel fixed single conversion
mode.
Interrupt routine processing example
WA ADREG3 Read value of ADREG3L, ADREG3H to general
purpose register WA (16 bits).
WA > > 6 Shift contents read into WA six times to right and zero-fill
upper bits.
(0800H) WA Write contents of WA to memory address 0800H.
2. Converts repeatedly the analog input voltages on the three pins AN0, AN1, and
AN2, using channel scan repeat conversion mode.
INTE0AD X 0 0 0
Disable INTAD.
ADMOD1 1 1 000010 Set pins AN0 to AN2 to be the analog input channels.
ADMOD0 X X 000111 Start conversion in channel scan repeat conversion
mode.
X : Don’t care, : No change