12-43
MSM66573 Family User's Manual
Chapter 12 Serial Port Functions
12
Baud rate generator (Timer 5) settings
If 1/2 of timer 5 overflow has been selected for use as the baud rate clock, implement the
following settings.
(1)
General-purpose timer 5 counter (TM5C)
Set the timer value that will be valid at the start of counting. When writing to TM5C, the same
value will also be simultaneously and automatically written to the general-purpose 8-bit
timer 5 register (TM5R).
(2)
General-purpose 8-bit timer 5 control register (TM5CON)
Bits 0 to 2 (TM5C0 to TM5C2) of this register specify the count clock for timer 5. If bit 3
(TM5RUN) is set to "1", timer 5 will begin counting. If reset to "0", timer 5 will halt counting.
[Equation to calculate baud rate]
B = f(TM5) 1/(256 – D) 1/2
B : baud rate [bps]
f(TM5) : timer 5 input clock frequency [Hz]
D : reload value (0 to 255)
12.7.4 SIO3 Operation
Transmission and reception are started by writing 8-bit data to the SIO3 register (SIO3R).
After the transmission and reception of 8 bits of data is complete, a transmit-receive
complete interrupt request is generated and the operation is complete.
In the master mode, the clock selected by bits 0 and 1 (SFT3CK0, SFT3CK1) of SIO3CON
is the shift clock. The shift clock is output from the SIOCK3 pin.
In the slave mode, the shift clock is input to the SIOCK3 pin. If 8 or more consecutive clock
pulses are input, the clock beginning with the 9th pulse will be ignored.
In both the master and slave modes, synchronized with the falling edge of the shift clock,
SIO3 outputs shift-out data from the SIOO3 pin. Synchronized with the rising edge of the
shift clock, shift-in data is input to the SIOI3 pin.
It is assumed that external devices change the shift-in data at the falling edge of the clock
and fetch the shift-out data at the rising edge of the clock.
When transmission and reception are started (data is written to SIO3R), the BUSY flag of
SIO3CON is set to "1". When 8 bits of data have been transmit and received, the BUSY
flag is automatically cleared to "0". When transmission and reception are completed, an
interrupt is generated in synchronization with the first state of the next instruction (M1S1).
Figure 12-20 shows the timing of SIO3 operation.