rx.txt

Warning: if you clip this code into your program, look out for possible html code slipping in.

REM   Example of RX() and TX() - Receiver
REM
REM   Author: Steven R. Wheeler
REM
REM   Copyright 2000 Vesta Technology, Inc.
REM   All rights reserved.

REM   This application is intended to run on an SBC2000-074 or SBC2000-062
REM   which is connected to another SBC2000. As the applications are written,
REM   both boards must be the same (that is, if the receiver board is an
REM   SBC2000-074, the transmitter board must be also).

REM   Connections:
REM     Transmitter Keyboard.7 to Receiver Keyboard.7
REM     Transmitter Keyboard.8 to Receiver Keyboard.8

REM   Declare the I/O bits

CONSTANT PORT AS BYTE =  6
CONSTANT RCV  AS BYTE =  6
CONSTANT XMT  AS BYTE =  7
GLOBAL   INTS AS BIT  = 11,7

REM   Declare the timeout location

CONSTANT Timeout AS BYTE = 0x29


REM   Declare the variables we'll use

GLOBAL info  AS INTEGER
GLOBAL number AS INTEGER

REM   Here is the application

INTS = 0				: REM   Turn off interrupts

LCD_Command(0x01)			: REM   Clear the display
PIPE PRINT LCD			: REM   Normal output to LCD
PRINT "Value           Count"
DO
	info = RX(PORT, RCV, 100, 16, 0)	: REM   Get info from transmitter
	LCD_Command(0xC0)				: REM   Position cursor
	PRINT info, "     "			: REM   Display received value
	number = number + 1			: REM   Bump received count
	LCD_Command(0xD0)				: REM   Reposition cursor
	PRINT number, "     "			: REM   Display it
	TX(PORT, XMT, 100, 16, 0, info)	: REM   Send it back
LOOP UNTIL 0