TMP91C824
91C824-188
Setting example:
①
Convert the analog input voltage on the AN3 pin and write the result, to memory address 0800H
using the A/D interrupt (INTAD) processing routine.
Main routine:
7 6 5 4 3 2 1 0
INTE0AD
←
X 1 0 0 - - -
-
Enable INTAD and set it to Interrupt Level 4.
ADMOD1
←
1 1 X X 0 0 1 1
Set pin AN3 to be the analog input channel.
ADMOD0
←
X X 0 0 0 0 0 1
Start conversion in Channel Fixed Single Conversion Mode.
Interrupt routine processing example:
WA
←
ADREG37
Read value of ADREG37L and ADREG37H into 16-bit
general-purpose register WA.
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.
②
This example repeatedly converts 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 X X X 0 0 1 0
Set pins AN0 to AN2 to be the analog input channels.
ADMOD0
←
X X 0 0 0 1 1 1
Start conversion in Channel Scan Repeat Conversion Mode.
(note): X = Don’t care; “
−
” = No change