tmp1941af TOSHIBA Semiconductor CORPORATION, tmp1941af Datasheet - Page 271

no-image

tmp1941af

Manufacturer Part Number
tmp1941af
Description
32-bit Tx System Risc
Manufacturer
TOSHIBA Semiconductor CORPORATION
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
TMP1941AF
Manufacturer:
TOSHIBA
Quantity:
48
Part Number:
TMP1941AF
Quantity:
4
Part Number:
tmp1941af(Z)
Manufacturer:
TOSHIBA/东芝
Quantity:
20 000
15.3 Programming Examples
Converting the analog input voltage on the AN3 pin to a digital value and storing the converted value in
a memory location (0xFFFF_B800) using an A/D interrupt (INTAD) handler routine
Converting the analog input voltages on AN0–AN2 sequentially in channel scan continuous conversion
mode
X = Don't care
Notes:
Settings in the main routine
IMCEHH
ADMOD1
ADMOD0
Interrupt routine processing example
r4
r4
(FFFFB800H) ←
IMCEHH
ADMOD1
ADMOD0
The ADC supports both polled and interrupt-driven operation. The CPU can perform polling
operation to detect completion of a conversion.
fadc: A/D conversion clock selected by the ADCCLK register
Don’t poll the ADRxRF bit in the ADREGxxL register.
In single conversion modes, poll the ADBF bit in the ADMOD0.
In any conversion modes, the EOCF bit in the ADMOD0 can be polled. After the EOCF bit is
set, one or two fadc clocks are required as shown below before the ADREGxH/L can be
read.
Fixed-channel single conversion mode
Fixed-channel continuous conversion mode
Channel scan single scan conversion mode
Channel scan continuous conversion mode
← X X 0 1 0 1 0 0
← 1 X X X 0 0 1 1
← X X 0 0 0 0 0 1
← X X 0 1 0 0 0 0
← 1 X X X 0 0 1 1
← X X 0 0 0 0 0 1
> > 6
7 6 5 4 3 2 1 0
ADREG37
r4
Conversion Mode
TMP1941AF-231
Enables INTAD and sets its priority level to 4.
Selects AN3 as the analog input channel.
Starts conversion in fixed-channel single conversion mode.
Loads the conversion result into general-purpose register r4 from
ADREG37L and ADREG37H.
Shifts the contents of r4 six bits to the right, padding 0s to the
vacated MSB bits.
Stores the contents of r4 to address 0xFFFF_B800.
Disables INTAD.
Selects AN0–AN2 as analog input channels.
Starts conversion in channel scan continuous conversion mode.
Time Required Before Reading the ADREGxx
2 fadc clocks
2 fadc clocks
1 fadc clock
1 fadc clock
TMP1941AF
2003-03-27

Related parts for tmp1941af