Intel 80C188EC User Manual page 351

Hide thumbs Also See for 80C188EC:
Table of Contents

Advertisement

SERIAL COMMUNICATIONS UNIT
$mod186
name
scu_async_example
;
; Example initialization code for the Serial Communications Unit.
;
; ASYNC_CHANNEL_SETUP sets up channel 0 as 9600 baud, full duplex, 7 data bits
; plus parity, with CTS# control.
;
; We assume serial port registers have been correctly defined and
; the PCB is located in I/O space.
B0CMP
EQU
S0CON
EQU
S0STS
EQU
S0RBUF
EQU
S0TBUF
EQU
code_seg
segment public
assume
cs:code_seg
ASYNC_CHANNEL_SETUP proc near
; Now set up channel 0 options
mov
mov
out
mov
mov
out
; Clear any old pending RI or TI, just for safety's sake.
mov
in
; Turn on the receiver
mov
in
or
out
; Now receiver is enabled and sampling of the RXD line begins.
; Any write to SxTBUF will initiate a transmission.
ret
ASYNC_CHANNEL_SETUP endp
code_seg
ends
end
11-22
0xxxx
; Channel 0 Baud Rate Compare
0xxxx
; Channel 0 Control
0xxxx
; Channel 0 Status
0xxxx
; Channel 0 Receive Buffer
0xxxx
; Channel 0 Transmit Buffer
ax, 8067H
; for 9600 baud from 16MHz CPU clock
dx, B0CMP
dx, al
; set baud rate
ax, 0059H
; CEN=1 (CTS enabled)
; REN=0 (receiver not enabled yet)
; EVN=1 (even parity)
; PEN=1 (parity turned ON)
; MODE=1 (10 bit frame)
dx, S0CON
dx, al
; write to Serial Control Reg.
dx, S0STS
ax, dx
; clear any old RI or TI
dx, S0CON
ax, dx
; Read S0CON
ax, 0020H
; Set REN bit
dx, al
; Write S0CON
Example 11-1. Asynchronous Mode 4 Example

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c186ec

Table of Contents