Toshiba H1 Series Data Book page 617

32bit micro controller tlcs-900/h1 series
Table of Contents

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
INTEAD
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
INTEAD
0
0
← 1
ADMOD1
1
0
← X
ADMOD0
X
0
3. Convert the analog input voltage on the AN2 pin as a high-priority AD conversion, and write the result to memory
address 2A00H using the High-priority AD interrupt(INTADHP) processing routine.
Main routine
← 1
INTEAD
1
0
← 1
ADMOD1
0
0
← 0
ADMOD3
0
1
← 0
ADMOD2
0
0
Interrupt routine processing example
← ADREGSP
WA
← > > 6
WA
← WA
(2A00H)
4. Convert the analog input voltage on the AN4 pin as a normal AD conversion of a channel fixed single conversion
mode. And then if its conversion result is greater or equal than the value of (ADCM0REGL/H), write the result to
memory address 2C00H using the AD monitor function interrupt (INTADM) processing routine.
Main routine
← −
INTEAD
← 0
ADMOD5
0
0
← 0
ADMOD4
0
1
← 1
ADMOD1
0
1
← 0
ADMOD0
0
0
Interrupt routine processing example
← ADREG4
WA
← > > 6
WA
← WA
(2C00H)
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.
1
Enable INTADHP and set it to interrupt level 6.
0
0
0
0
0
DAC On.
0
0
0
0
0
Set pin AN2 to be the analog input channel.
0
1
0
0
0
Start a high-priority AD conversion by software.
Read value of ADREGSPL and ADREGSPH 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 2A00H.
1
0
1
1
Enable INTAD and set it to interrupt level 3.
0
1
0
0
0
Set the analog input channel AN4 for AD monitor function 0.
0
0
0
0
0
Enable the AD monitor function0 and AD monitor function
interrupt 0. Set "a conversion result ≥ AD conversion result
compare criterion register" for generation condition of monitor
function interrupt 0.
0
0
0
0
0
Set pin AN4 to be the analog input channel.
0
1
0
0
0
Start a normal AD conversion by software.
Read value of ADREG4L and ADREG4H 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 2C00H.
92CZ26A-614
TMP92CZ26A

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tlcs-900Tmp92cz26axbg

Table of Contents