12.07.2015 Views

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

80C186EB/80C188EB Microprocessor User's Manual - CEUNES

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

SERIAL COMMUNICATIONS UNIT$mod186nameexample_slave_1_routine;**************************************************************;; slave_1;; FUNCTION: This function represents a slave unit connected to a multi-; processor master/slave network. This slave responds to two; commands:; Flash the LEDs on the EVAL Board, and; Disconnect from the Network.; Other commands are easily added.;; SYNTAX: extern void far slave_1(void);;; INPUTS: None;; OUTPUTS: None;; NOTE: Parameters are passed on the stack as required by high-level; languages. The slave should be running this code before the; master calls the slave. Example assumes PCB is in I/O space.;**************************************************************;substitute register offsets in place of xxxxhP1CON equ xxxxh ;Port 1 Control registerP1LTCH equ xxxxh ;Port 1 Latch registerP2CON equ xxxxh ;Port 2 Control registerS1CON equ xxxxh ;Serial Port 1 Control registerS1STS equ xxxxh ;Serial Port 1 Status registerS1TBUF equ xxxxh ;Serial Port 1 Transmit BufferS1RBUF equ xxxxh ;Serial Port 1 Receive Bufferlib_80186segment public 'code'assume cs:lib_80186My_Address equ 01h ;slave 1 network addressTriStateEna equ 08h ;Tri-state buffer enableTriStateDis equ 00h ;Tri-state buffer disableFlashLEDs equ 01h ;list of commands unit 1 responds toDisconnect equ 0fhpublic_slave_1_slave_1 proc farpush ax ;save registers that will be modifiedpush bxpush cxpush dxExample 10-5. Master/Slave — The slave_1 Routine10-32

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

Saved successfully!

Ooh no, something went wrong!