
Programmable Four-Channel Communications Controller
—
CD2481
Datasheet
107
8.2
Async Interrupt Setup Example
This section shows an example for an asynchronous channel running at 19,200 bits per second,
with 8 bits/character, 1 Stop bit, and no parity. The sample program enables in-band flow control
and implied XON mode. This code assumes that the proper channel has been set by the CAR
(Channel Access register).
outportb( LIVR, 0x40 );
outportb( RCOR, 0 );// Receive clock option
outportb( RBPR, 0x81 );// Baud Rate divisor
outportb( TCOR, 0 );// Transmit clock option
outportb( TBPR, 0x81 );// Baud Rate divisor
outportb( CMR, ASYNC );// Async Mode, interrupt
outportb( COR1, PARIGN | CHAR8 );// 8 bit chars, no parity
outportb( COR2, IXM | TXIBE );// in-band flow, implied XON
outportb( COR3, STOP1 | FCT );// 1 stop, flow control
outportb( COR4, thresh );// FIFO threshold
outportb( COR5, 0 );
8.3
HDLC DMA Channel Setup Example
This per-channel initialization example is for the HDLC protocol at 38.4 kbps with NRZI
encoding. The setup specifies two extra opening flags before frames, no address matching, and that
DMA transfers should be used.
outportb( LIVR, 0x30 );// Set interrupt vector
outportb( RCOR, DPLL_NRZI );// Receive clock option
outportb( RBPR, 64 );// Baud rate divisor
outportb( TCOR, 0 );// Transmit clock option
outportb( TBPR, 64 );// Baud rate divisor
outportb( CMR, RX_DMA | TX_DMA | HDLC );// Mode register
outportb( CPSR, CPSR_CRC_V41 );// CRC polynomial select