Toshiba H1 SERIES TLCS-900 User Manual

Page 212

Advertising
background image

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

5

4

3

2

1

0

INTE0AD

← X 1 0 0 − − − −

Enable INTAD and set it to interrupt level 4.

ADMOD1

← 1 1 0 0 0 0 1 1

Set pin AN3 to 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

← 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 0 0 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.

X

: Don’t care, − : No change

Advertising
This manual is related to the following products: