23.04.2013 Views

TMPM330 - Keil

TMPM330 - Keil

TMPM330 - Keil

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

13.4.5 High-priority Conversion Mode<br />

Under development<br />

<strong>TMPM330</strong> (rev 0.4)13 -22<br />

<strong>TMPM330</strong><br />

By interrupting ongoing normal A/D conversion, top-priority A/D conversion can be<br />

performed. Top-priority A/D conversion can be software activated by setting<br />

ADMOD2 to "1" or it can be activated using the HW resource by setting<br />

ADMOD3 to an appropriate setting. If top-priority A/D conversion has been<br />

activated during normal A/D conversion, ongoing normal A/D conversion is interrupted,<br />

and single conversion is performed for a channel designated by ADMOD2. The<br />

result of single conversion is stored in ADREGSP, and the top-priority A/D conversion<br />

interrupt is generated. After top-priority A/D conversion is completed, normal A/D<br />

conversion is resumed; the status of normal A/D conversion immediately before being<br />

interrupted is maintained. Top-priority A/D conversion activated while top-priority A/D<br />

conversion is under way is ignored.<br />

For example, if channel repeat conversion is activated for channels AN0 through AN8<br />

and if is set to "1" during AN3 conversion, AN3 conversion is suspended,<br />

and conversion is performed for a channel designated by . After the result<br />

of conversion is stored in ADREGSP, channel repeat conversion is resumed, starting<br />

from AN3.<br />

13.4.6 A/D Monitor Function<br />

If ADCMPx is set to "1," the A/D monitor function is enabled. If the value of<br />

the conversion result storage register specified by REGS becomes larger or<br />

smaller ("larger" or "smaller" to be designated by ADOBIC) than the value of a<br />

comparison register, the A/D monitor function interrupt is generated. This comparison<br />

operation is performed each time a result is stored in a corresponding conversion result<br />

storage register, and the interrupt is generated if the conditions are met. Because storage<br />

registers assigned to perform the A/D monitor function are usually not read by software,<br />

overrun flag is always set and the conversion result storage flag is<br />

also set. To use the A/D monitor function, therefore, a flag of a corresponding conversion<br />

result storage register must not be used.<br />

13.4.7 Storing and Reading A/D Conversion Results<br />

A/D conversion results are stored in upper and lower A/D conversion result registers for<br />

normal A/D conversion (ADREG08H/L through ADRG7FH/L).<br />

In fixed channel repeat conversion mode, A/D conversion results are sequentially stored<br />

in ADREG08H/L through ADREG7FH/L. If is so set as to generate the interrupt<br />

each time one A/D conversion is completed, conversion results are stored only in<br />

ADREG08H/L. If is so set as to generate the interrupt each time four A/D<br />

conversions are completed, conversion results are sequentially stored in ADREG08H/L<br />

through ADREG3BH/L.<br />

Table 13-2 shows analog input channels and related A/D conversion result registers.<br />

Analog/ Digital Converter

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!