Download TOSHIBA - DigChip
Transcript
TMP96C141AF 3.12.1 Operation (1) Analog Reference Voltage High analog reference voltage is applied to the VREF pin, and low analog reference voltage is applied to AGND pin. The reference voltage between VREG and AGND is divided by 1024 using ladder resistance, and compared with the analog input voltage for A/D conversion. (2) (4) (6) A/D Conversion Mode Both fixed A/D conversion channel mode and A/D conversion channel scan mode have two conversion modes, i.e., single and repeat conversion modes. In fixed channel repeat mode, conversion of specified one channel is executed repeatedly. In scan repeat mode, scanning from AN0, … → AN3 is executed repeatedly. A/D conversion mode is selected by ADMOD <REPET, SCAN>. TOSHIBA CORPORATION A/D Conversion End and Interrupt • A/D conversion single mode ADMOD <EOCF> for A/D conversion end will be set to “1,” ADMOD <ADBF> flag will be reset to “0,” and INTAD interrupt will be enabled when A/D conversion of specified channel ends in fixed conversion channel mode or when A/D conversion of the last channel ends in channel scan mode. • A/D conversion repeat mode For both fixed conversion channel mode and conversion channel scan mode, INTAD should be disabled when in repeat mode. Always set the INTE0AD at “000,” that disables the interrupt request. Write “0” to ADMOD <REPET> to end the repeat mode. Then, the repeat mode will be exited as soon as the conversion in progress is completed. (7) Starting A/D Conversion A/D conversion starts when A/D conversion register ADMOD <ADS> is written “1". When A/D conversion starts, A/D conversion busy flag ADMOD <ADBF> which indicates “A/D conversion is in progress” will be set to “1". A/D Conversion Speed Selection There are two A/D conversion speed modes: high speed mode and low speed mode. The selection is executed by ADMOD <ADCS> register. When reset, ADMOD <ADCS> will be initialized to “0,” so that high speed conversion mode will be selected. Analog Input Channels Analog input channel is selected by ADMOD <ADCH1, 0>. However, which channel to select depends on the operation mode of the A/D converter. In fixed analog input mode, one channel is selected by ADMOD <ADCH1, 0> among four pins: AN0 to AN3. In analog input channel scan mode, the number of channels to be scanned from AN0 is specified by ADMOD <ADCH1, 0>, such as AN0 → AN1, AN0 → AN1 → AN2, and AN0 → AN1 → AN2 → AN3. When reset, A/D conversion channel register will be initialized to ADMOD <ADCH1, 0> = 00, so that AN0 pin will be selected. The pins which are not used as analog input channel can be used as ordinary input port P5. (3) (5) Storing the A/D Conversion Result The results of A/D conversion are stored in ADREG0 to ADREG3 registers for each channel. In repeat mode, the registers are updated whenever conversion ends. ADREG0 to ADREG3 are read-only registers. (8) Reading the A/D Conversion Result The results of A/D conversion are stored in ADREG0 to ADREG3 registers. When the contents of one of ADREG0 to ADREG3 registers are read, ADMOD <EOCF> will be cleared to “0". Setting example: When the analog input voltage of the AN3 pin is A/D converted and the result is stored in the memory address FF10H by A/D interrupt INTAD routine. 143