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.

• Example baud rate setting:<br />

Under development<br />

1) Division by an integer (divide by N):<br />

<strong>TMPM330</strong> (rev 0.4) 9-11<br />

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

Selecting fc = 39.321 MHz for fperiph, setting φT0 to fperiph/16, using the baud rate<br />

generator input clock φT1, setting the divide ratio N (SC0BRCR) = 4, and<br />

setting SC0BRCR = “0,” the resulting baud rate in the UART mode is<br />

calculated as follows:<br />

* Clocking conditions System clock : High-speed (fc)<br />

High speed clock gear : x 1 (fc)<br />

Prescaler clock<br />

fc/32<br />

Baud rate = /16<br />

4<br />

= 39.321 × 10<br />

: fperiph/16 (fperiph = fsys)<br />

6 ÷ 32 ÷ 4 ÷ 16 ≒ 19200 (bps)<br />

(Note) The divide by (N + (16-K)/16) function is inhibited and thus SC0BRADD<br />

is ignored.<br />

2) For divide by N + (16-K)/16 (only for UART mode):<br />

Selecting fc = 9.6 MHz for fperiph, setting φT0 to fperiph/8, using the baud rate<br />

generator input clock φT1, setting the divide ratio N (SC0BRCR) = 7,<br />

setting K (SC0BRADD) = 3, and selecting SC0BRCR = 1,<br />

the resulting baud rate is calculated as follows:<br />

* Clocking conditions System clock : High-speed (fc)<br />

High-speed clock gear : x 1 (fc)<br />

Prescaler clock : fperiph/4 (fperiph = fsys)<br />

fc/16<br />

Baud rate =<br />

/16<br />

(16 - 3)<br />

7 +<br />

16<br />

= 9.6 × 10 6 ÷ 16 ÷ ( 7 + 13)<br />

÷ 16 = 4800 (bps)<br />

16<br />

Also, an external clock input may be used as the serial clock. The resulting baud rate<br />

calculation is shown below:<br />

Serial Channel (SIO)

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

Saved successfully!

Ooh no, something went wrong!