Mode 0 Example - Intel 80C188EC User Manual

Hide thumbs Also See for 80C188EC:
Table of Contents

Advertisement

11.5.2 Mode 0 Example

Example 11-2 shows a sample Mode 0 application.
$mod186
name
;**************************************************************
; FUNCTION: This function transmits the user's data, user_data, serially
; over RXD1. TXD1 provides the transmit clock. The transmission frequency
; is calculated as follows:
;
;
tran_freq = (0.5*CLKIN/BAUDRATE)-1
;
; A 0-1-0 pulse on P1.0 indicates the end of transmission.
;
; SYNTAX:
extern void far parallel_serial(char user_data,int tran_freq)
;
; INPUTS:
user_data - byte to send out serially
;
tran_freq - baud rate compare value
; OUTPUTS:
None
; NOTE:
Parameters are passed on the stack as required by high-level
;
languages.
;**************************************************************
B1CMP
equ
S1CON
equ
S1STS
equ
S1TBUF
equ
;xxxx - substitute register offset
;Example assumes that all the port pins are configured correctly and
;PCB is located in I/O space.
lib_80186
segment public 'code'
assume cs:lib_80186
public
_parallel_serial
_parallel_serialproc far
push bp
mov
user_data
equ word ptr [bp+6];get parameters off the stack
tran_freq
equ word ptr [bp+8]
push ax
push dx
mov
example_SCU_mode_0
xxxxH
;Channel 1 Baud Rate Compare
xxxxH
;Channel 1 Control
xxxxH
;Channel 1 Status
xxxxH
;Channel 1 Receive Buffer
;save caller's bp
bp, sp
;get current top of stack
;save registers that
;will be modified
dx, S1STS
;clear any pending exceptions
Example 11-2. Mode 0 Example
SERIAL COMMUNICATIONS UNIT
11-23

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c186ec

Table of Contents