[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

IMPORTANT NOTES: There is no carriage-return delay built into the output channel. This means that a normal RS-232 printer cannot correctly print, unless some form of hold-off (asking the Commodore 64 to wait) or internal buffering is implemented by the printer. The hold-off can easily be implemented in your program. If a CTS (x-line) handshake is implemented, the Commodore 64 buffer will fill, and then hold-off more output until transmission is allowed by the RS-232 device. X-line handshaking is a handshake routine that uses multi- lines for receiving and transmitting data.

The routine CHKOUT handles the x-line handshake, which follows the EIA standard (August 1979) for RS-232-C interfaces. The RTS, CTS, and DCD lines are implemented with the Commodore 64 defined as the Data Terminal Device.


Closing an RS-232 file discards all data in the buffers at the time of execution (whether or not it had been transmitted or printed out), stops all RS-232 transmitting and receiving, sets the RTS and transmitted data (Sout) lines high, and removes both RS-232 buffers.


   CLOSE lfn


NOTE: Care should be taken to ensure all data is transmitted before closing the channel. A way to check this from BASIC is:
 100 SS=ST: IF(SS=0 OR SS=8) THEN 100
 110 CLOSE lfn

[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated May 20, 1998.