Download Print this page

Toshiba TLCS-900/H1 Series Manual page 315

Original cmos 32-bit microcontroller
Hide thumbs Also See for TLCS-900/H1 Series:

Advertisement

Setting example:
1. Convert the analog input voltage on the AN3 pin and write the result to memory address 2800H using the AD
interrupt (INTAD) processing routine.
Main routine:
7
6
5
← 1
INTE0AD
1
0
← 1
ADMOD1
1
0
← X
ADMOD0
X
0
Interrupt routine processing example:
← ADREG3
WA
← > > 6
WA
← WA
(2800H)
2. This example repeatedly converts the analog input voltages on the three pins AN0, AN1 and AN2, using channel
scan repeat conversion mode.
← 1
INTE0AD
0
0
← 1
ADMOD1
1
0
← X
ADMOD0
X
0
X: Don't care, −: No change
4
3
2
1
0
0
Enable INTAD and set it to interrupt level 4.
0
0
0
1
1
Set pin AN3 to be the analog input channel.
0
0
0
0
1
Start conversion in channel fixed single conversion mode.
Read value of ADREG3L and ADREG3H into 16-bits
general-purpose register WA.
Shift contents read into WA six times to right and zero fill
upper bits.
Write contents of WA to memory address 2800H.
0
Disable INTAD.
0
0
0
1
0
Set pins AN0 to AN2 to be the analog input channels.
0
0
1
1
1
Start conversion in channel scan repeat conversion mode.
92CH21-313
TMP92CH21
2009-06-19

Advertisement

loading

This manual is also suitable for:

Tmp92ch21fgJtmp92ch21