Asynchronous Serial Ports (UARTs)
Am186™CC/CH/CU Microcontrollers User’s Manual
13-7
13.5.1.2.3
Receiving Data
When the receiver is initialized, to receive data:
1. Read the (H)SPSTAT register:
a. Verify that the RDR bit is set to 1 to ensure the RDATA field contains valid data.
b. Read the other status bits to check the status on the last byte received and clear any
status bits that were set.
2. Read data from the (H)SPRXD register (this clears the RDR bit to 0). The (H)SPRXDP
register is also available to peek at the data. This register is a duplicate of the receive
register; however, reading it does not clear the RDR bit.
13.5.1.3
Autobaud Mode (High-Speed UART Only)
The procedure to program autobaud mode is described here. To program a transmit, see
page 13-5; to program a receive, see page 13-6.
1. Verify that the TMODE and RMODE bits in the HSPCON0 register are cleared to ensure
there are no transfers in progress.
2. Set the baud rate with the HSPBDV register. The register value cannot be 0; a value
must be written into this register before enabling a transmit or receive.
3. Set the autobaud enable (ABAUD) bit in the HSPCON1 register to 1.
4. Optionally, to address errors in computing autobaud, program the High Speed Serial
Port Autobaud (HSPAB0, HSPAB1, HSPAB2, and HSPAB3) registers with thresholds
and divisors. This method compensates for distortion of start bit width resulting from
external effects.
5. Clear all the bits in the HSPSTAT register to 0.
6. Set the applicable configuration options in the HSPCON0 register—interrupts, breaks,
CTS/RTR hardware flow control, parity (odd, even, or none), address bit enable, number
of data bits in serial frame (7 or 8), and stop bit length (one or two)—and enable the
receive by setting the RMODE bit in the HSPCON0 register to 1. These bits can be set
simultaneously, but RMODE cannot be set before any of the other bits described in steps
2–6. If no information is known about the data to be received, set the options to 8 bits,
no parity, and no address bit. The TMODE bit must be 0; a transmit cannot be occurring
while the receiver is computing autobaud.
7. Wait for the ABAUD bit in the HSPCON1 register to go to 0 to indicate that the autobaud
operation is complete. The computed baud divisor is automatically copied into the
HSPBDV register, and the autobaud (ABAUD) bit in the HSPCON1 register is cleared.
8. Read the new baud divisor value from the HSPBDV register and check that it is a valid
divisor value or is acceptable.
9. Wait for the RDR bit in the HSPSTAT register to be set to 1 to ensure the RDATA field
contains valid data.
10.Read data from the HSPRXD register (this clears the RDR bit to 0). In autobaud mode,
the receiver is expecting a 1 in the least significant bit of the data (i.e., a valid autobaud
character such as an ascii a). Software must check that this value is valid.
This procedure sets the autobaud rate for both the transmitter and the receiver. The receiver
can continue to receive data unless there is a need to reconfigure the options (see “Receive”
on page 13-6). The transmitter can now be enabled by setting the TMODE bit to 1.
Содержание Am186 CC
Страница 1: ...Am186 CC CH CU Microcontrollers User s Manual Order 21914B...
Страница 4: ...iv Am186 CC CH CU Microcontrollers User s Manual...
Страница 18: ...Table of Contents xviii Am186 CC CH CU Microcontrollers User s Manual...
Страница 24: ...Introduction xxiv Am186 CC CH CU Microcontrollers User s Manual...
Страница 39: ...Architectural Overview Am186 CC CH CU Microcontrollers User s Manual 1 15 Figure 1 6 32 Channel Linecard CH CC...
Страница 40: ...Architectural Overview 1 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 86: ...System Overview 3 36 Am186 CC CH CU Microcontrollers User s Manual...
Страница 92: ...Emulator Support 4 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 112: ...DRAM Controller 6 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 134: ...Interrupts 7 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 186: ...Programmable I O Signals 9 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 200: ...Watchdog Timer 11 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 232: ...Asynchronous Serial Ports UARTs 13 24 Am186 CC CH CU Microcontrollers User s Manual...
Страница 242: ...Synchronous Serial Port SSI 14 10 Am186 CC CH CU Microcontrollers User s Manual...
Страница 264: ...High Level Data Link Control HDLC 15 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 332: ...Universal Serial Bus USB 18 34 Am186 CC CH CU Microcontrollers User s Manual...
Страница 348: ...Register Summary A 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 376: ...Index Index 18 Am186 CC CH CU Microcontrollers User s Manual...