Page 300
20. 10-bit AD Converter (ADC)
20.4 Register Setting
TMP89FM42
RA001
20.4 Register Setting
1. Set the AD converter control register 1 (ADCCR1) as described below:
• From the AD input channel select (SAIN), select the channel in which AD conversion is to be per-
formed.
• Set the analog input control (AINEN) to "Analog input enable".
• At AMD, specify the AD operating mode (single or repeat mode).
2. Set the AD converter control register 2 (ADCCR2) as described below:
• At the AD conversion time (ACK), specify the AD conversion time. For information on how to specify
the conversion time, refer to the AD converter control register 2 and Table 20-1.
3. After the above two steps are completed, set "1" on the AD conversion start (ADRS) of the AD converter
control register 1 (ADCCR1), and AD conversion starts immediately if single mode is selected.
4. As AD conversion is finished, the AD conversion end flag (EOCF) of the AD converter control register 2
(ADCCR2) is set to "1", the AD conversion result is stored in the AD converted value registers (ADCDRH
and ADCDRL), and the INTADC interrupt request is generated.
5. After the conversion result is read from the AD converted value register (ADCDRH), EOCF is cleared to
"0". EOCF will also be cleared to "0" if AD conversion is performed once again before reading the AD con-
verted value register (ADCDRH). In this case, the previous conversion result is retained until AD conver-
sion is finished.
20.5 Starting STOP/IDLE0/SLOW Modes
If STOP/IDLE0/SLOW mode is started, registers ADCCR1<ADRS, AMD, AINEN>, ADCCR2<EOCF, ADBF>,
ADCDRL and ADCDRH are initialized to "0". If any of these modes is started during AD conversion, AD conver-
sion is suspended, and the AD converter stops (registers are likewise initialized). When restored from STOP/ IDLE0/
SLOW mode, AD conversion is not automatically restarted. Therefore, registers must be reconfigured as necessary.
If STOP/IDLE0/SLOW mode is started during AD conversion, analog reference voltage is automatically discon-
nected and, therefore, there is no possibility of current flowing into the analog reference voltage.
Example: After selecting the conversion time 15.6
µ
s at 10 MHz and the analog input channel AIN3 pin, perform AD con-
version once. After checking EOCF, store the conversion result in the HL register. The operation mode is single
mode.
: (Port setting)
; Before setting AD converter registers, make an appropriate port regis-
ter setting.(For further details, refer to the section that describes I/O
ports.)
LD
(ADCCR1), 0y00110011
; Select AIN3.
LD
(ADCCR2), 0y00000011
; Select conversion time (156/fcgck) and operation mode.
SET
(ADCCR1). 7
; ADRS = 1 (AD conversion start)
SLOOP :
TEST
(ADCCR2). 7
; EOCF = 1 ?
JRS
T, SLOOP
LD
HL, (ADCDRL)
; Read result data
Содержание TLCS-870/C1 Series
Страница 1: ...8 Bit Microcontroller TLCS 870 C1 Series TMP89FM42 查询TMP89FM42供应商 捷多邦 专业PCB打样工厂 24小时加急出货 ...
Страница 3: ...Revision History Date Revision 2007 10 25 1 First Release 2007 11 3 2 Contents Revised ...
Страница 4: ......
Страница 14: ......
Страница 18: ...1 3 Block Diagram TMP89FM42 1 3 Block Diagram Figure 1 2 Block Diagram ...
Страница 22: ...1 4 Pin Names and Functions TMP89FM42 ...
Страница 60: ...2 CPU Core 2 5 Revision History TMP89FM42 ...
Страница 76: ...3 Interrupt Control Circuit 3 8 Revision History TMP89FM42 ...
Страница 86: ...4 External Interrupt control circuit 4 3 Function TMP89FM42 ...
Страница 102: ...7 Voltage Detection Circuit 7 5 Revision History TMP89FM42 ...
Страница 126: ...8 I O Ports 8 3 I O Port Registers TMP89FM42 Note 2 i 0 to 1 ...
Страница 136: ...8 I O Ports 8 5 Revision History TMP89FM42 ...
Страница 142: ...9 Special Function Registers 9 3 SFR3 0x0E40 to 0x0EFF TMP89FM42 ...
Страница 146: ...10 Low Power Consumption Function for Peripherals TMP89FM42 ...
Страница 149: ...TMP89FM42 11 3 Revision History Rev Description RA001 Deleted SLEEP2 description ...
Страница 150: ...11 Divider Output DVO 11 3 Revision History TMP89FM42 ...
Страница 220: ...15 Real Time Clock RTC 15 4 Real Time Clock Operation TMP89FM42 ...
Страница 250: ...16 Asynchronous Serial Interface UART 16 15 Revision History TMP89FM42 ...
Страница 302: ...18 Serial Bus Interface SBI 18 7 Revision History TMP89FM42 ...
Страница 336: ...21 Flash Memory 21 4 Toggle Bit D6 TMP89FM42 Note 1 Make sure that you set the C register to 0x00 LD FLSCR2 0xD5 ...
Страница 338: ...21 Flash Memory 21 4 Toggle Bit D6 TMP89FM42 ...
Страница 384: ...22 Serial PROM Mode 22 15 Revision History TMP89FM42 ...
Страница 388: ...24 Input Output Circuit 24 1 Control Pins TMP89FM42 ...
Страница 404: ...25 Electrical Characteristics 25 11 Revision History TMP89FM42 ...
Страница 406: ...26 Package Dimensions TMP89FM42 ...
Страница 408: ......