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.

Under development<br />

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

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

13.4.3 Starting A/D Conversion<br />

Two types of A/D conversion are supported: normal AD conversion and top-priority AD<br />

conversion. Normal AD conversion is software activated by setting ADMOD0 to<br />

"1." Top-priority AD conversion is software activated by setting ADMOD2 to<br />

"1." 4 operation modes are made available to normal AD conversion. In performing<br />

normal AD conversion, one of these operation modes must be selected by setting<br />

ADMOD0 to an appropriate setting. For top-priority AD conversion, only one<br />

operation mode can be used: fixed channel single conversion mode. Normal AD<br />

conversion can be activated using the HW activation source selected by<br />

ADMOD3, and top-priority AD conversion can be activated using the HW<br />

activation source selected by ADMOD3. If this bit is "0," normal and top-priority<br />

AD conversions are activated in response to the input of a falling edge through the<br />

ADTRG pin. If this bit is "1," normal AD conversion is activated in response to TB1RG6<br />

generated by the 16-bit timer 6, and top-priority AD conversion is activated in response to<br />

TB2RG5 generated by the 16-bit timer 5. Software activation is still valid even after H/W<br />

activation has been authorized.<br />

(Note) When an external trigger is used for the HW activation source of a top priority analog<br />

to digital translation, an external trigger cannot usually be set as analog to digital<br />

translation HW activation.<br />

(Note) The <strong>TMPM330</strong> disables the external trigger used for H/W activation. Therefore “0”<br />

cannot be set to and .<br />

When normal A/D conversion starts, the A/D conversion Busy flag (ADMOD0)<br />

showing that A/D conversion is under way is set to "1." When top-priority A/D conversion<br />

starts, the A/D conversion Busy flag (ADMOD2) showing that A/D<br />

conversion is under way is set to "1." At that time, the value of the Busy flag for normal<br />

A/D conversion before the start of top-priority A/D conversion is retained. The value of<br />

the conversion completion flag EOCFN for normal A/D conversion before the start of<br />

top-priority A/D conversion can also be retained.<br />

(Note) Normal A/D conversion must not be activated when top-priority A/D conversion is<br />

under way. In that case, the top-priority A/D conversion completion flag cannot be<br />

set, and the flag for previous normal A/D conversion cannot be cleared.<br />

To reactivate normal A/D conversion while the conversion is under way, a software reset<br />

(ADMOD4) must be performed before starting A/D conversion. The HW<br />

activation method must not be used to reactivate normal A/D conversion.<br />

If ADMOD2 is set to "1" during normal A/D conversion, ongoing A/D<br />

conversion is discontinued and top-priority A/D conversion starts; specifically, A/D<br />

conversion (fixed channel single conversion) is executed for a channel designated by<br />

ADMOD2. After the result of this top-priority A/D conversion is stored in the storage<br />

register ADREGSP, normal A/D conversion is resumed.<br />

Analog/ Digital Converter

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

Saved successfully!

Ooh no, something went wrong!