Asynchronous Serial Ports (UARTs)
13-6
Am186™CC/CH/CU Microcontrollers User’s Manual
When extended writes and address bits are enabled, 9-bit data should be written to the
(H)SPTXD register. The first word should include the AB bit value (set the transmit AB
(AB) bit in the (H)SPTXD register to 1 followed by the address bits in the TDATA field).
Then the following words should contain AB = 0 and the data for the designated address
point.
Hardware stops writing to the (H)SPTXD register when TXDRQ goes to 0; when
TXDRQ = 1, hardware continues writing the data. In the case of DMA, the hardware
handles the data flow from the DMA unit to the SPTXD register automatically using an
internal DMA signal.
5. Wait for the TEMT bit in the (H)SPSTAT register to go to 1 to indicate the on-line transfer
has completed.
13.5.1.2
Receive
The procedure to program a receive is described below. To program a transmit, see
page 13-5. To use autobaud, see page 13-7. Transfers can be done in Polled, Interrupt, or
DMA modes.
13.5.1.2.1
Initializing the Receiver
The following procedure initializes the receiver. Before reconfiguring any options (including
the baud rate), disable any receives. To do this, check that RDR=0 and IDLED=1 in the
(H)SPSTAT register to ensure no data is in the receiver, and then clear the RMODE bit to 0.
Interrupt masks can be changed without disabling the receiver (clearing RMODE to 0).
13.5.1.2.2
Setting the Baud Rate with the (H)SPBDV Register
1. If character matching is desired (High-Speed UART only), load the High Speed Serial
Port Character Match (HSPM0, HSPM1, and HSPM2) registers with the characters to
be matched. Each match register contains two character fields. Note that 00h is a valid
value so if you do not want the 00h character to be matched, all six character fields
should be initialized, even if it is with the same value.
2. Set the applicable configuration options in the (H)SPCON1 register: break value,
extended read, external/internal clock, and, on the High-Speed UART only, FIFOs and
character matching. If FIFOs are enabled with the RFEN bit, the RFLUSH bit should
also be set at the same time (or before) to flush the FIFO. If comparing characters in
frames with address bits, the three MAB bits should be configured. Each MAB bit setting
(1 or 0) is used as the address bit for both characters in the corresponding match register.
As with the character match registers, all three bits should be set.
3. Set the interrupts to be taken with the (H)SPIMSK register. Bits in this register enable
interrupts based on interrupts set in the (H)SPCON0 register. Note that corresponding
bits must be set in both registers for the interrupt to be taken. If an interrupt is disabled
in (H)SPIMSK, the status can still be read.
4. Write all the bits in the (H)SPSTAT register to 0 to clear any status.
5. Set the applicable configuration options in the (H)SPCON0 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 (H)SPCON0 register to 1. All of these bits can
be set simultaneously but RMODE cannot be set before any of the other bits described
in steps 1–5.
Содержание 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...