beautypg.com

Addendum to section 10: serial i/o module, 1 serial usart i/o pins and control registers, 2 serial usart code examples – Maxim Integrated MAXQ Family Users Guide: MAXQ2010 Supplement User Manual

Page 57: Maxq family user’s guide: maxq2010 supplement

background image

MAXQ Family User’s Guide:

MAXQ2010 Supplement

10-1

ADDENDUM TO SECTION 10: SERIAL I/O MODULE

The MAXQ2010 provides two serial universal synchronous/asynchronous receiver-transmitter (USART) interfaces
(serial 0 and 1) that operate as described in the MAXQ Family User’s Guide.

10.1 Serial USART I/O Pins and Control Registers

Table 10-1. Serial USART Input and Output Pins

Table 10-2. Serial USART Control Registers

10.2 Serial USART Code Examples

10.2.1 Serial USART Example: Echo Characters in 10-Bit Asynchronous Mode

move SCON0.6, #1

; Set to mode 1 (10-bit asynchronous)

move SCON0.4, #1

; Enable receiver

move SMD0.1, #1

; Baud rate = 16 x baud clock

move PR0, #007DDh

; P = 2^21 * 9600 / 10.000MHz

move SCON0.0, #0

; Clear received character flag

move SCON0.1, #0

; Clear transmit character flag

move Acc, #0Dh

call TxChar0

move Acc, #0Ah

call TxChar0

move Acc, #’>’

call TxChar0

move Acc, #’ ‘
call TxChar0

SERIAL USART FUNCTION

PIN

MULTIPLEXED WITH GPIO

RX0: Serial 0 Receive

68

P5.0

TX0: Serial 0 Transmit

67

P5.1

RX1: Serial 1 Receive

28

P6.4

TX1: Serial 1 Transmit

25

P6.5

REGISTER

ADDRESS

FUNCTION

SCON0

M3[04h]

Serial Port 0 Control Register. Serial port mode, receive enable, 9th bit control, and interrupt flags.

SBUF0

M3[05h]

Serial Port 0 Data Buffer. Input and output data buffer.

SMD0

M3[08h]

Serial Port 0 Mode Register. Controls baud rate, interrupt enable, and framing error detection.

PR0

M3[09h]

Serial Port 0 Phase Register. Contains counter reload value for baud-rate generation.

SCON1

M3[06h]

Serial Port 1 Control Register. Serial port mode, receive enable, 9th bit control, and interrupt flags.

SBUF1

M3[07h]

Serial Port 1 Data Buffer. Input and output data buffer.

SMD1

M3[0Ah]

Serial Port 1 Mode Register. Controls baud rate, interrupt enable, and framing error detection.

PR1

M3[0Bh]

Serial Port 1 Phase Register. Contains counter reload value for baud-rate generation.