beautypg.com

2 baud rate generation, Eneration – Maxim Integrated Secure Microcontroller User Manual

Page 118

background image

Secure Microcontroller User’s Guide

118 of 187

14.2 Baud Rate Generation

As shown in Serial Port Control Register, the baud rate clock source for the serial I/O is determined by
the selection of the operating mode.

In Modes 0 and 2, the baud rate is divided down from the clock oscillator frequency by a fixed value. In
Mode 0, the baud rate is 1/12 of the clock oscillator frequency, or:

Mode 0 Baud Rate =

CLK

12t

1


In Mode 2, the baud rate is either 1/32 or 1/64 of the clock oscillator frequency. This selection is
dependent on the state of the SMOD bit (PCON.7). If SMOD=0, the baud rate will be 1/64 the clock
oscillator frequency. If SMOD=1, the baud rate is 1/32 the clock oscillator frequency. This can also be
given as:

Mode 2 Baud Rate =

64

2

SMOD

X

CLK

t

1


Note that 2

SMOD

means two to the power of SMOD. 2

0

=1, 2

1

=2


The baud rates in Modes 1 and 3 are variable because they are a function of the Timer 1 overflow signal
and the value of the SMOD bit. A general equation that describes the baud rate frequency can be given as:

Mode 1, 3 Baud Rate =

32

2

SMOD

X

T1

t

1


where, t

T1

is the overflow period of Timer 1. In this application Timer 1 can be configured in either the

timer or the counter configuration. If the counter configuration is selected, then the baud rate frequency
will be divided down from an external clock source applied to the P3.3 (

INT1

) pin. As a general

guideline, the GATE bit for Timer 1 should be 0 if the counter function is selected in this situation so that
a continuous clock source will be available for the baud generator.

In most applications, Timer 1 will be configured as a timer that uses the internal clock oscillator
frequency as its clock source. The baud rate will then be divided down from the time base applied to the
XTAL1 and XTAL2 pins. In order to provide the most flexibility, Timer 1 should be programmed to
operate in Mode 2 that configures TL1 as an 8-bit timer that is automatically reloaded with the value held
in TH1 when its timeout condition is reached. This operational mode is selected by assigning the TMOD
register control bits in the following configuration:

D7

D6

D5

D4

D3

D2

D1

D0

GATE

C/

T

M1

M0

GATE

C/

T

M1

M0

0

0

1

0

X

X

X

X


In the configuration selected above, the baud rate for the serial port can be expressed as:

Serial I/O Mode 1, 3 Baud Rate =

32

2

SMOD

X

(TH1))

-

(256

12t

1

CLK