Chapter 4 Software Development

For further details on these components, refer to the MSM6657 Family User's Manual.

Serial port (SIO0): Chapter 12

Internal timer:

Chapter 8, page 9 and following

The source code file stdrw573.c sets up the serial port for these functions using the following steps between the start and end comments for port and timer setup.

(1)Configure timer 3 for use as baud rate generator (BRG)

The serial port used for standard I/O derives its baud rate from the MSM66Q573 internal timer 3 overflow signal. The source code file stdrw573.c contains the settings for producing a 38,400- b/s baud rate from the JOB60851 board's 24-MHz system clock.

(2)Configure serial port

All serial ports have registers for controlling operation. SIO0 has four such registers.

(a)SIO0 Transmit Control Register

This register specifies the data format for transmitting data and enables or disables the relevant interrupts. The source code file stdrw573.c uses the following settings.

Word size

8 bits

Stop bits

2

Parity check

None

Transmit buffer empty interrupt

Enabled

Transmission end interrupt

Enabled

(b)SIO0 Receive Control Register

This register specifies the data format for receiving and enables or disables the relevant interrupts. The source code file stdrw573.c uses the following settings.

Word size

8 bits

Baud rate clock

Timer 3

Parity check

None

Receive end interrupt

Enabled

SIO0 receive

Enabled

(c)SIO0 Receive/Transmit Buffer Register

This 8-bit register holds the transfer data. It is actually two separate registers differentiated by access. Writing to it writes to the transmit buffer. Reading from it reads from the receive buffer.

(d)SIO0 Status Register

This status register gives the error status at the end of transmit/receive operations and the running status during such operations. Note that the hardware does not reset this register, so the user application program must do so before using the serial port.

Framing error flag

"0"

Overrun error flag

"0"

Parity error flag "0"

 

Transmit buffer empty flag

"0"

Transmit end interrupt flag

"0"

page 4-28

Page 63
Image 63
Oki JOB60851 user manual Serial port SIO0 Chapter Internal timer 9 and following