03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SERIAL COMMUNICATIONS UNIT<br />

11.3.3.2 BCLK as Baud Timebase Clock<br />

BCLK does not run directly into the baud timebase clock, but is first synchronized to the CPU<br />

clock. BCLK causes the baud timebase clock to increment, but transitions on TXD and RXD (for<br />

transmissions) still occur relative to CLKOUT.<br />

A low-to-high transition on BCLK increments BxCNT. If BxCNT is equal to BxCMP, TXD goes<br />

low approximately 4½ CLKOUTs later. TXD will always remain low for two CLKOUT periods<br />

and then go high. TXD will go low again 4½ CLKOUTs after BxCNT equals BxCMP. Therefore,<br />

the output frequency on TXD is roughly equal to the input frequency on BCLK multiplied by Bx-<br />

CMP. There will be some clock jitter, as the output on TXD will always be some multiple of<br />

CLKOUTs. This is due to the internal synchronization.<br />

11.4 SERIAL COMMUNICATIONS UNIT INTERRUPTS<br />

Serial communication is usually interrupt-driven. An interrupt needs to occur on each reception<br />

and on each transmission of a character. The RI and TI flags in the SxSTS register (Figure 11-14<br />

on page 11-16) provide the interrupt mechanism for the serial ports. The two serial ports, or channels,<br />

have different interrupt circuitry. Serial channel 0 is directly supported by the integrated Interrupt<br />

Control Unit. Serial channel 1 is supported by the RXI1 and TXI1 outputs. RXI1 and TXI1<br />

go active during the stop bit of receive and transmit sequences, respectively. These outputs can<br />

be connected to external interrupt pins. .<br />

11.5 SERIAL PORT EXAMPLES<br />

This section contains examples that show ways to use the serial port.<br />

NOTE<br />

The examples assume that the Peripheral Control Block is located in I/O space.<br />

11.5.1 Asynchronous Mode Example<br />

Example 11-1 contains sample code to initialize Serial Port 0 for 9600-baud operation in asynchronous<br />

Mode 4.<br />

11-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!