Intel 80C188EC User Manual page 355

Hide thumbs Also See for 80C188EC:
Table of Contents

Advertisement

SERIAL COMMUNICATIONS UNIT
$mod186
name
;*******************************************************************
; FUNCTION:
This function demonstrates how to implement the three
; master/slave routines (_slave_1, _select_slave, and _send_slave_command)
; in a typical setup.
;
; NOTE:
It is assumed that the network is set up as shown in
;
Figure 11-18, that the slave unit is running the
;
_slave_1 code, and that the PCB is located in I/O space.
;
;*******************************************************************
Slave1
equ
Flash
equ
Disc
equ
False
equ
lib_80186
segment public 'code'
extrn
_select_slave:far
extrn
_send_slave_cmd:far
lib_80186
ends
code
segment public 'code'
assume cs:code
public
_main
_main
proc near
push Slave1
;send the address over the network
call far ptr _select_slave
add
cmp
je
push Flash
;send it
call far ptr _send_slave_cmd
add
;insert a delay routine to allow completion of last command
push Disc
;send it
call far ptr _send_slave_cmd
add
SlaveExit:
ret
_main
endp
code
ends
end _main
Example 11-3. Master/Slave — Implementing the Master/Slave Routines
11-26
example_master_slave
01h
;address assigned to slave unit 1
01h
;command to flash EVAL board LEDs
0fh
;command to disconnect from network
00h
;declare external routines
;get slave unit 1 address
sp, 2
;adjust sp
ax, false
;was slave 1 properly selected ?
SlaveExit
;no: then exit
;yes: then send Flash command
sp, 2
;adjust sp
;prepare to disconnect slave
sp, 2
;adjust sp

Advertisement

Table of Contents
loading

This manual is also suitable for:

80c186ec

Table of Contents