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 />

The block diagram of this mode is shown below.<br />

TB0IN0<br />

φT1<br />

φT4<br />

φT16<br />

TB0RG0-WR<br />

Selector<br />

Selector<br />

TB0CR<br />

16-bit comparator<br />

TB0RG0<br />

Register buffer 0<br />

16-bit up-counter UC0<br />

Clear<br />

F/F<br />

(TB0FF0)<br />

Match<br />

Internal data bus<br />

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

TB0RUN<br />

TB0OUT (PPG output)<br />

16-bit comparator<br />

TB0RG1<br />

Register buffer 1<br />

Fig. 8-4 Block Diagram of 16-bit PPG Mode<br />

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

Each register in the 16-bit PPG output mode must be programmed as listed below.<br />

7 6 5 4 3 2 1 0<br />

TB0EN ← 1 X X X X X X X Starts the TMRB0 module.<br />

TB0RUN ← X X X X X 0 X 0 Stops the TMRB0 module.<br />

TB0RG0 ← * * * * * * * * Specifies a duty. (16 bits *32-bits for register)<br />

← * * * * * * * *<br />

TB0RG1 ← * * * * * * * * Specifies a cycle. (16 bits *32-bits for register)<br />

← * * * * * * * *<br />

TB0CR ← 1 0 X 0 0 0 0 0 Enables the TB0RG0 double buffering.<br />

(Changes the duty/cycle when the INTTB0 interrupt is<br />

generated)<br />

TB0FFCR ← X X 0 0 1 1 1 0 Specifies to trigger TB0FF0 to reverse<br />

when a match with TB0RG0 or TB0RG1 is detected,<br />

and sets the initial value of TB0FF0 to "0."<br />

TB0MOD ← 0 0 1 0 0 1 * * Designates the prescaler output clock as the input clock,<br />

(** = 01, 10, 11) and disables the capture function.<br />

PICR<br />

PIFR1<br />

←<br />

←<br />

−<br />

−<br />

−<br />

-<br />

−<br />

−<br />

−<br />

−<br />

−<br />

−<br />

−<br />

−<br />

−<br />

−<br />

1<br />

1<br />

Assigns PI0 to TB0OUT<br />

TB0RUN ← * * * * * 1 X 1 Starts TMRB0<br />

X; Don’t care −; no change<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!