23.04.2013 Views

TMPM330 - Keil

TMPM330 - Keil

TMPM330 - Keil

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Under development<br />

8.4.3 16-bit Programmable Square Wave Output Mode (PPG)<br />

<strong>TMPM330</strong> (rev 0.4)8-27<br />

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

Square waves with any frequency and any duty (programmable square waves) can be<br />

output. The output pulse can be either low-active or high-active.<br />

Programmable square waves can be output from the TB0OUT pin by triggering the timer<br />

flip-flop (TB0FF) to reverse when the set value of the up-counter (UCO) matches the set<br />

values of the timer registers (TB0RG0 and TB0RG1). Note that the set values of TB0RG0<br />

and TB0RG1 must satisfy the following requirement:<br />

(Set value of TB0RG0) < (Set value of TB0RG1)<br />

Match with B0RG0<br />

(INTTB0 interrupt)<br />

Match with B0RG1<br />

(INTTB1 interrupt)<br />

TB0OUT pin<br />

Fig. 8-2 Example of Output of Programmable Square Wave (PPG)<br />

In this mode, by enabling the double buffering of TB0RG0, the value of register buffer 0 is<br />

shifted into TB0RG0 when the set value of the up-counter matches the set value of<br />

TB0RG1. This facilitates handling of small duties.<br />

Match with TB0RG0<br />

Up-counter = Q1<br />

Match with TB0RG1<br />

TB0RG0<br />

(compare value)<br />

Register buffer<br />

Q1<br />

Q2<br />

Fig. 8-3 Register Buffer Operation<br />

Up-counter = Q2<br />

Trigger to shift to TB0RG1<br />

Q2<br />

Write TB0RG0<br />

Q3<br />

16-bit Timer/<br />

Event Counters (TMRBs)

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

Saved successfully!

Ooh no, something went wrong!