HBI-232 SERVICE MANUAL SPECIFICATIONS Communication mode Baud rate Signal description Data format Sync mode Transmit/receive mode Selectable by software 50, 75, 110, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200 bps (bits per second) See next page. Selectable by software Data length: 5, 6, 7, or 8 bits Stop bit(s): 1, V/ 2 , or 2 bit(s) Parity: even, odd, ignore, or no parity Asynchronous mode Full duplex mode General Power requirement and power consumption Operating temperature and humidity Dimensions Weight + 12 V, 20 mA -12 V, 20 mA + 5 V, 230 mA 5 to 35°C (41 to 95°F), 25 to 80% Approx. 109 x 132 x 26.4 mm (w/h/d) (4 3 / 8 x 51/4 x 1V 16 inches) Approx. 270 g (9.5 oz) RS-232C INTERFACE CARTRIGE SONY Scanned and converted to PDF by HansO, 2001 TABLE OF CONTENTS 1. EXPLANATION 1-1. WHAT IS THE RS-232C?.. 3 1-2. SYSTEM CONFIGURATION. 3 1- 3. PREPARATION. 4 1-3-1. Switching the Signal Flow. 5 1- 3-2. Setting the RS-232C Data Format and Communication Mode. 6 2- 1. PRACTICING RS-232C SERIAL DATA COMMUNICATION. 7 2- 1-1. Data and Program Communication. 7 2- 2. TERMINAL OPERATION. 10 3- 1. COMMANDS AND FUNCTIONS OF THE MSX-BASIC FOR RS-232C COMMUNICATION. 11 3- 1-1. Introductory Remarks. 11 3-1-2. List of Commands and Functions for RS-232C. 11 3-1-3. MSX-BASIC Commands and Functions. 12 2. BLOCK DIAGRAM 21 3. SCHEMATIC DIAGRAM AND PRINTED CIRCUIT BOARD IF-104. 23 IF-104 BOARD. 25 SEMICONDUCTOR PIN ASSIGNMENTS. 26 4. REPAIR PARTS AND FIXTURE 4- 1. EXPLODED VIEW. 30 4-2. ELECTRICAL PARTS LIST . 31 4-3. PACKING MATERIAL AND ACCESSORY. 31 - 2 - CHAPTER 1 EXPLANATION 1-1 WHAT IS THE RS-232C? The MSX computer has a variety of functions as a stand-alone perso¬ nal computer. You can make your own programs using MSX-BASIC, for example, store them on an external memory device such as a floppydisk, and the program can later be loaded and executed, or modified, printed out, and so forth. The RS-232C can further expand the functions of the stand-alone com¬ puter by providing you, the user of the MSX computer, with communi¬ cation with other devices such as a computer. By setting up communi¬ cations with other personal computers, you can exchange the pro¬ grams or data with the other computer lovers who live far away from you. This is because the RS-232C conforms to the industry standard for serial data interface between a modem and a terminal equipment standardized by the EIA (Electronic Industries Association), and two computers with the RS-232C interfaces can be connected via the modems and the telephone line, for example. An increasing number of personal computers have the RS-232C standard interface, and bet¬ ween these computers communication can easily be performed. Before performing communication through the RS-232C interface, you may have to work on system set-up, communication mode settings such as transmit/receive speed, data length, and signal control. All those jobs which are said to be a little troublesome, can easily be executed using MSX-BASIC commands and functions specially provided for RS-232C communication. The usage of MSX-BASIC commands and functions is thoroughly covered in this manual. 1-2 SYSTEM CONFIGURATION To perform communication through the RS-232C interfaces, there are mainly three types of system configuration. The following illustrations show the examples when MSX computers have RS-232C interfaces on them. Connecting two computers directly via the RS-232C interface cable This system is used to exchange data files between the computers via the RS-232C interface, for example. Connecting two computers via telephone line This system enables communicating with the equipment far away. Connecting to peripherals This system allows the MSX computer to utilize peripherals, such as a printer which is provided with an RS-232C interface. - 3 - CONNECTIONS 1-3 PREPARATION Setting the signal direction select switch Slide the signal direction select switch up or down according to the type of the device to be connected. To connect to modem-type equipment, such as a modem or an acoustic coupler: Slide the switch to the TO MODEM position. To connect to terminal-type equipment, such as a computer, a printer, or a display monitor: Slide the switch to the TO TERMINAL position. The following flow chart indicates how to start RS-232C communi¬ cation. For details of each procedure, refer to the page shown in . ' The RS-232C port is the RS-232C interface on the MSX computer, or on the RS-232C interface Cartridge. - 4 - 1-3-1 SWITCHING THE SIGNAL FLOW To connect two terminal equipments (computers) There are two types of RS-232C interface specifications: MODEM type and TERMINAL type. Since the RS-232C is a standard for serial data communication between a modem and a terminal equipment, MODEM type interface and TERMINAL type interface can be directly connected with a standard straight cable. However, if two MODEM type equipments or two TERMINAL type equipments are connected, a cross cable called a null modem cable is required. With the Sony MSX computer, switching between MODEM/TERMINAL can easily be per¬ formed using the signal direction select switch so that MODEM or TERMINAL equipment can be connected to the MSX computer with¬ out the null modem cable.. If the equipment to be connected is a TERMINAL type, set the switch to TO TERMINAL position, and if it is a MODEM type, set the switch to TO MODEM position. The function and flow direction of the signals when the MSX computer's switch is set to TO MODEM is as follows: Pin No. Signal name Function when MSX computer’s switch is set to TO MODEM Singal flow TERM-—-MODEM 1 FG Protective ground 2 SD (TXD) Transmit data 3 RD (RXD) Receive data 4 RS (RTS) Notifies the connected device that your MSX computer is ready to start transmitting data (Request to Send). -► 5 CS (CTS) The connected device notifies your MSX computer that it is ready to receive data. (Clear to Send) 6 DR (DSR) The connected device notifies your MSX computer that it is ready for both transmitting and receiving data. (Data Set Ready) 7 SG Signal ground 8 CD (DCD) The connected modem notifies your MSX computer that it has detected the carrier signal 1 ’. (Data Carrier Detect) 9-19 NC No connection 20 ER (DTR) Notifies the connected device that your MSX computer is ready for both transmitting and receiving data. (Data Terminal Ready) 22 Cl (R!) The connected modem notifies that it has detected the telephone ringing. ^Carrier detect signal is used to notify that the communication line is operative when the computers are connected to a telephone line through the modems (acoustic couplers) and a telephone line. TERMINAL (computer) Sony MSX computer is designated to a modem equipment by setting the swith to TO TERMINAL position. / TERMINAL MODEM TERMINAL (computer) (Sony MSX (computer) computer) SD * RD • RS • CS • 6 DR * 20 ER — •SD • RD ■ RS • CS • DR • ER A null modem cable required. Interface connector pin assignment No null modem cable required. C 2 3 4 5 6 7 8 oooooooo 200 220 - 5 - 1-3-2 SETTING THE RS-232C DATA FORMAT AND COMMUNICATION MODE Before starting communication through the RS-232C interface, data format such as data length, parity, etc. and the transmit/receive speed have to be set. In addition, communication control modes specially provided for the MSX computer are available. All those data format and communication mode settings can be made using the MSX extended BASIC command “COMINI” (see page 18). Data format and communication speed | Data format | In the MSX computer, data is handled in 8-bit (1 byte) unit. In addition, data transmit/receive is performed in asynchronous mode in which no sync character is used to transmit/receive data and specified data format assures of correct data communication. The same data format needs to be specified in both transmitter and receiver in the RS-232C serial data communication so that data can be exchanged without fail. The chart below shows the typical data format for transmitting ASCII character in asynchrounous mode which is often employed in the MSX computer. To transmit “S” (53H = 01010011b) i -o i o m q m o om n / / 0 Stop bit(s) (Tj Start bit (TjData^^ / *— J (character “S”) (Tj Parity bit (0 or 1) [T] Start bit This bit indicates that the character following this bit is the data character. This bit is defined to be 0. Example Character data = “A”(41H) Data length = 8 bits Even parity 0 01000001 F -S 001000001 \parity bit OK!: The total number of binary Is is even. 0 OlOOOdOl F ~^> 001100001 Error!: The total number of binary Is is odd. The type of the parity check can be selected out of the following 4 types. No parity check type is usually employed in the MSX computer. Even parity: Odd parity: No parity: Ignore parity: Total number of binary “1”s is always set to even. Total number of binary "1”s is always set to odd. No parity check which is often employed in the RS- 232C communication. When transmitting, no parity bit will be sent to the connected device, and when receiving the received parity bit will be ignored. This mode is effective only when the data length is 5 to 7 bits. (T)Stop bit length The stop bit(s) is added at the end of a data character, and it indicates the end of the data. For the RS-232C communication, stop bit length has to be defined. Either 1 bit, 1.5 bits, or 2 bits is selectable, and 1-bit stop bit lengh is usually employed in the MSX computer. |T) Data length For the RS-232C communication, data length of one character has to be defined according to the type of data to be transmit¬ ted/received. The data length is specified in bit units, and 8*bit data length is usually employed in the MSX computer. 5 bits i Used for special purposes such as domestic or 6 bits t international telex for example. 7 bits: Used only for ASCII code 8 bits: Used to exchange a program in machine language, or codes of 80H to FFH. (T) Parity bit length The “parity bit” can be utilized for the RS-232C communication so that incorrect data transfer can be detected. This is the error check¬ ing method in which the total number of binary “1”s in a character data is always even or always odd. The value of the parity bit is automatically set to 1 or 0 so that the total number of binary “1 ”s in a character data and the parity bit is always even or always odd. | Baud rate j Baud rate is the data flow speed to transmit or receive data including start bit and stop bit(s) specified by the number of bits per second. The same speed has to be specified in both the connected devices on a communication line. However, it is possible to set a different speed for transmitting and receiving data in one device. One of the following baud rates can be selected: 50, 75, 110, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200 bps (bits/second) When communicating via an acoustic coupler and a telephone line, it is recommended to specify 300 or 1200 bps. Note: To perform communication using BASIC, it is recommended to set a speed at or lower than 1200 bps so that correct data transfer is assured. To set communication control modes The following communication control modes are useful to modify the data delimiter according to the connected device, prevent data over¬ flow, and so forth. | Shift-in/shift-out control j When the connected device on the other side uses 7-bit JIS (Japan Industry Standard) character set, the SI code (OFH) and SO code (OEH) control is used. SI code notifies that data following the code is the Japanese Katakana characters, and SO code the alphanumeric characters. Since the MSX computer usually employs 8-bit character data, it is not necessary to specify SI/SO control unless the connected device uses the 7-bit JIS character set. | Automatic line feed insert/delete controTj The MSX computer uses a set of carriage return code (ODH) and line feed code (OAH) as a data delimiter. However, to communicate with a computer which puts only a carriage return code as a data delimiter, the line feed code after the carriage return code has to be deleted when transmitting data, and has to be added when receiving data by activating this control mode. To perform RS-232C serial data communication with another MSX computer, normally it is not necessary to specify this mode. 1 XON/XOFF control j In RS-232C communication, data to transmit or received data is once stored in a specified buffer area which is called a file. The XON/XOFF control mode preventes overflow of the buffer. In this method, the re¬ ceiver will send an XOFF code (13H) to the transmitter when 113 cha¬ racters of data is in the receive buffer (128 characters), and will send XON code (11H) when there are 2 characters remaining in the receive buffer. The transmitter will suspend data transmission when it receives the XOFF code, and will resume data transmission when it receives XON code. When the computer is connected to a device which is not programmed to use the overflow control such as a printer, do not activate this over¬ flow control mode. [ CS-RS handshake] In this method, computer first sends the RS (Request to Send) signal to the modem to notify that it is to start data transmission, and when the modem sends back the CS (Clear to Send) signal to the computer, the computer starts data transmission. Namely, data exchange is started after the connected modem notifies the computer that it is ready to receive data responding to the request of data transmission from the computer. Normally, CS-RS handshake control is employed. If the CS-RS hand¬ shake is activated with the MSX computer, the computer will suspend data transmission by PRINT#, SAVE, until the CS signal is set to ON. When the CS-RS handshake method is not adopted in the connected device, do not specify the CS-RS handshake method. | Time out j When CS-RS handshake is designated, data transmission is not resumed until the CS signal changes to ON. If a certain time is speci¬ fied, time out error can be signaled. The time out error will be declared when the specified time has elapsed before the CS signal is set to ON, which prevents the computer from endlessly waiting for the CS signal set to ON. The time is specified in seconds in the range from 0 to 255. 2-1 PRACTICING RS-232C SERIAL DATA COMMUNICATION There are mainly two ways of using serial data communication for your MSX computer: data/program exchange with another computer or operating the MSX computer as a terminal of the other host computer. In the terminal mode, all your MSX computer can do is sending data from the keyboard, or receiving program from the host computer, for example. 2-1-1 DATA AND PROGRAM COMMUNICATION Basic procedure for transmitting or receiving data The following is the basic procedure for transmitting or receiving data after preparation is made. Setting a specified area in the memory is required for data exchange in the RS-232C communication. (Not necessary for transmitting/receiciving program) The specified area is called a file. For details of the MSX-BASIC command names described below, see the explanation in Paragraph 3. - OPEN-Opens a file used as a transmit or receive buffer where data is written for transmission or data is received. PRINT# or INPUT#(--Writes data to the opened RS-232C ' transmit buffer file, or reads data from the opened RS-232C receive buffer file, and assigns it to a variable. CLOSE-Closes the receive/transmit buffer file opened by the OPEN statement to declare the end of the RS-232C serial data communication. Note The signals status will be as follows: RS signal: ON when the OPEN statement is executed. OFF when the CLOSE statement is executed. ER signal: ON when the computer is turned on. CS signal: In case CS-RS handshake control is activated by the MSX- BASIC command COMINI, data transmission by the PRINT# will be suspended until the CS signal is set to ON. Basic procedure for transmitting or receiving program If the connected device is another MSX computer, the transmitted or received programs can be utilized in both MSX computers. However, when the connected device is an other type of computer, the ex¬ changed programs cannot be utilized either in the connected com¬ puter or in your MSX computer. However, if the MSX-BASIC programs is transmitted as a data file from an other type of computer to your MSX computer, you can use the MSX-BASIC program (see the program example on page 9). For details of the MSX-BASIC command names described below, see the explanation in Paragraph 3. The following are the MSX-BASIC commands to transmit or receive program via a specified RS-232C port (interface) after preparation is made. - 7 - |SAVE| --Sends a program in ASCII format through the specified RS-232C port. |LOADf --Loads a program in ASCII format from the specified RS-232C port 1 Declares the name of numeric type array variables from A (0) to A (2) £ where the value of A, B, and C will be assigned. 2 Initializes the RS-232C port numbered 0 (see page 11) so that the data format and communication modes settings will be performed as follows: Notes The signals status will be as follows: RS signal: ON before and while receiving a program. OFF after receiving a program. ER signal: ON when the computer is turned on. CS signal: In case CS-RS handshake control is activated by the MSX-BASIC command COMINI, program transmission by the SAVE will be suspended until the CS signal is set to ON. Examples for transmitting and receiving data The following example is the case in which numeric data input from the keyboard of the MSX computer A is transmitted to the MSX com¬ puter B where the input numeric data is processed and then displayed on the monitor screen. The calculation A + B + C = will be performed on the MSX com¬ puter B according to the numeric data input from the MSX computer A. The result of the calculation will be displayed on the monitor screen connected to the MSX computer B. ^Program for MSX computer A as a transmitters ! 0 DIM A ( 2 ) ----- 20 CALL COM I N1 ( "0 : 8N3XNNNN", 300, 300, 5 )- 30 OPEN "COMO:" FOR OUTPUT AS #1 - 40 PRINT: PRINT "Input data to send" - 50 INPUT " A = ";A( 0 ) —| 00 INPUT ”B = ";A(1) -—- 70 INPUT "C =" ; A( 2 ) —' 8 0 PRINT Jl,"Start" ----- 9 0 S $ = " " --- 100 FOR 1=0 TO 2 110 IF I < > 2 THEN S£ = S$ + STR$(A( I ) ) +" , " ELSE 120 NEXT I 130 PRINT # 1 , S $ --- 140 PRINT ^1 , "End"---' 150 SOTO 40 -2 -3 -4 -5 S £ = + STR $ ( A ( I ,T} 8 -10 The each step above means: RS-232C port number: 0 (0) Data length: 8 bits (8) Parity check: No parity check (N) Stop bit: 2 bits (3) XON/XOFF control: Enables control (X) CS-RS handshaking: No handshaking (N) Automatic line feed insert/delete: No insert/delete (NN) Shift-in/shift-out control: No control (N) Transmit/receive speed: 300 bps (,300,300) Time out: 5 seconds (,5) 3 Opens the file for the RS-232C transmit buffer with the file number 1 . 4 Displays the message “Input data to send” on the monitor screen. 5 Prompts you to input the value of the variables A (0), A (1), and A (2) from the keyboard, one by one according to the displays “A = ”, “B = ”, and “C = ” on the monitor screen. 6 Sends the message “Start” to the connected MSX computer B. 7 Assigns a null string to the string type variable S$ so that value set in S$ will be cleared. 8 Converts numeric type data assinged to the variables A (0), A (1), A (2) to the string type variable S$. 9 Writes data assigned to the S$ to the transmit buffer file 1 so that the data will be sent to the MSX computer B. 10Sends the message “End” to the connected MSX computer B. < Program for MSX computer B as a receiver^ 10 CALL COMINI {"0:8N3XNNNN", 300 ; 300, 5 ) - 20 OPEN "COMO:" FOR INPUT AS ffl - 30 print: PRINT "ffffffff Now waiting data ffffffff" 40 LINE INPUT ffl , G $ 50 IF G^"Start" THEN 60 ELSE 30 60 INPUT ffl, A,B,C 70 PRINT "A=";A 80 PRINT "B=";B 90 PRINT "c=";c 100 D = A + B + C 110 PRINT "a+b+c=";d 120 LINE INPUT ffl , G$ 130 IF G ='" End" THEN 30 ELSE 120 140 END □ " ZP 2 3 4 5 The each step above means: 1 Initializes the RS-232C port numbered 0 so that the data format and communication modes settings will be performed the same as the MSX computer A, the transmitter. 2 Opens the file for the RS-232C receive buffer with the file number 1. 3 Displays the message “#### Now waiting data ####” on the monitor screen. 4 Starts reading data from the receive buffer file, and assigns it to numeric type variables A, B, and C if the message “Start” is sent from the transmitter. 5 Displays the numeric data assigned to the variables A, B and C on the monitor screen. 6 Calculates “A + B + C” and displayes the answer “D” by numeric constants. 7 If the “End” message is sent from the transmitter, waits for another data input from the transmitter’s keyboard. 8 - Examples for transmitting and receiving a data file The following example is the case in which data is exchanged, bet¬ ween the two MSX computers. The data file of a MSX-BASIC program stored in a floppydisk of computer A is transmitted to and received by the MSX computer B, and the data file is stored on a destination floppydisk of the MSX comptuer B. Any desired file on the source floppydisk can be specified for transmission by inputing its file name from the keyboard. ^Program for MSX computer A as a transmitters 10 MAX FIL E S = 2-1 20 INPUT "Input data file name to send:";F$-2 30 PRINT '7MNow sending data JTffflJf" -3 40 CALL COMINI ( "0 : 8N3XNNNN" , 300 , 300 , 5 )-4 50 OPEN "COMO;" FOR OUTPUT AS #1 -5 60 OPEN F$ FOR INPUT AS ff2 -6 70 BUF^ = "Start" : PRINT /P1,BUF$ -7 80 IF EO F( 2 ) THEN GOTO 120 — 90 LINE INPUT #2,BUF$ _ 8 100 PRINT ff 1 , BUF$ 110 GOTO 80 - 120 BUF^="End" : PRINT /?l,BUF$-i 130 CLOSE -9 140 END -1 The each step above means: 1 Declares the number of files that can be simultaneously opened in this program is 2. 2 Prompts the user to input the name of the file to be transmitted from the keyboard. The input file name will be assinged to the variable F$. 3 Displays the message “#### Now sending data ####” on the monitor screen. 4 Initializes the RS-232C port numbered 0 so that the data format and communication modes settings will be performed as follows: RS-232C port number: 0 (0) Data length: 8 bits (8) Parity check: No parity check (N) Stop bit: 2 bits (3) XON/XOFF control: Enables control (X) CS-RS handshaking: No handshaking (N) Automatic line feed insert/delete: No insert/delete (NN) Shift-in/shift-out control: No control (N) Transmit/receive speed: 300 bps (,300,300) Time out: 5 seconds (,5) 5 Opens the RS-232C file for the transmit buffer as the file number 1. 6 Opens the data file “F$” stored on the floppydisk of the MSX com¬ puter A as the file number 2. • The mode “INPUT” is specified so that the contents of the file number 2 can be read and assigned to a string type variable. 7 Sends the message “Start” to the connected MSX computer B. 8 Checks if the EOF (end-of-file) code has been read from the file number 2. If EOF code has not been received, reads a character string one by one from the file number 2 on the floppydisk, and then assigns it to a string type variable BUF$. Writes data assigned to the BUF$ to the transmit buffer file 1 so that the data will be sent to the MSX computer B. 9 If the EOF (end-of-file) code has been received in the file numbered 2, the message “End” will be sent to the MSX computer B, and all opened files will be closed, and this program will end. "End" THEN BUF${N)=S$ ELSE 160 130 PRINT BUf|(N} 140 N = N + 1 150 GOTO 110 160 PRINT"77#Now saving data 170 N = N- 1 180 FOR 1=1 TO N 1 90 PRINT ffl , BL]f| ( I ) 200 NEXT 210 CLOSE 220 END -2 -3 -4 -5 -9 -10 3 The each step of the above program means: 1 Declares the number of files simultaneously opened in this program is 2. 2 Sets the size of the character string area to 2000 bytes in memory. 3 Declares an area of 501 string type variables from BUF$ (0) to BUF$ (500). 4 Prompts the user to input the name of the file to save the received data from the keyboard. 5 Initializes the RS-232C port numbered 0 so that the same data format and communication modes settings as the MSX computer A are performed on the MSX computer B. 6 Opens the receive buffer file with the file number 1. 7 Opens the data file “F$” on a floppydisk of the MSX computer B with the file number 2 so that received data file will be written into the file. • The mode “OUTPUT” is specified so that the received data will be written into the file numbered 2. 8 Waits for the massage “Start” to be sent from the transmitter. 9 Upon receipt of the message “Start", starts receiving character strings one by one until the message “End” will be sent from the transmitter. While receiving character strings one by one, the cha¬ racter string last received is displayed on the screen. - 9 - 10 Upon receipt of the message “End”, the message “#### Now saving data ####” will be displayed on the screen, and starts writing the received data in the receive buffer to the file numbered 2 on the floppydisk. 11 Closes all opened files when all data in the receive buffer is stored on the floppydisk, and the program wilt end. Examples for transmitting and receiving a program The following example is the case in which MSX computer A will transmit a program in an ASCII format, and the MSX computer B will receive the program also in an ASCII format until EOF (end-of-file) code is received. The RS-232C communication port number 0 is uti¬ lized in both transmitter and receiver. MSX computer A (transmitter) J CALL COMINI("0:8N3XNNNN", 1 200,1 200,5) SAVE "COMO:" MSX computer B call comini ("0 : 8 n 3 xnnnn, i 200,1 200 ,5 ) (receiver) load "como:" 2-2 TERMINAL OPERATION In this mode, your MSX computer is often connected to the host com¬ puter through a modem equipment (acoustic coupler), for example, and is used as a terminal of the host computer. If set to the terminal mode, the program of your MSX computer is no longer operative, and all your MSX computer can do is to just display the data transmitted from the host computer, and to input the data from the keyboard to transmit to the host computer. However, various extra functions are also available using the keyboard as shown below. Basic procedure to set up a terminal The following is the MSX-BASIC command for setting your MSX computer to a terminal of a host computer after preparation is made. For details of the MSX-BASIC command discribed below, see the explanation in Paragraph 3. ICOMTERMl .Sets your MSX computer to work as a terminal. To reset the t ermina l, or to exit from the terminal mode, press the 1CTRLI key and [STOP] key simultaneously. Note The RS signal is held ON while your MSX computer is working as a terminal. Extra terminal functions using the keyboard The data received from the host computer, or input from the keyboard and transmitted to the host computer, is also displayed on the screen, printed out, and so forth. In addition, the break sequence 1 ’ can be transmitted using the keys on the keyboard of your MSX computer. Press the following set of keys to activate the extra terminal function mode. ISHIFTI +[F3 Displays the received control codes (00H to 1FH) by “a” and the cha¬ racter assigned to the control code plus 40H. ex.) The return code (0DH) will be displayed as follows: a M To exit from this function mode, press the |SHIFT| and [Fl] keys simultaneously again. ^Break sequence: The break sequence are used to set the SD signal to spacing state 0. ! SHIFT 1 + [F2] Displays the data input from the keyboard on the screen. To exit from this function mode, press the iSHIFTl and [F2lkeys simultanously again. ISHIFTI + [F3] Displays and prints out the data input from the k eyboard at the same time. To exit from this function mode, press the iSHIFTl and fF3l keys simultaneously again. [STOP| Press and hold this key to transmit break sequence to the host com¬ puter. Nole_ The |SHIFT| key is identical with the[T]key on the MSX computers such as HB-10P. - 10 - 3-1 COMMANDS AND FUNCTIONS OF THE MSX-BASIC FOR RS-232C COMMUNICATION 3-1-2 LIST OF COMMANDS AND FUNCTIONS FOR RS-232C The MSX-BASIC commands and functions are specially provided for the RS-232C communication. Using those commands and functions, various communication modes, interrupt control, receive/trasmit control, all of which are indispensable for the RS-232C communi¬ cation, can easily be set. The follwoing MSX-BASIC commands and functions are divided into two categories: MSX-BASIC commands and functions used for RS-232C communication Extended MSX-BASIC commands for RS-232C communication .Executed with the “CALL” statement The commands and functions in each category are explained in alpha¬ betical sequence. 3-1-1 INTRODUCTORY REMARKS /Command, function name ■Mi load (load) Loads a BASIC program from the RS-232C port.---Function FORMAT LOAD “COM [port number]:"!,R] Format Integer type constants, O^port number^4 0- Input condition When input is omitted tQU Loads a BASIC program only. FUNCTION AND UTILIZATION Supplementary command and function explanations, and execution examples in which commands and functions are utilized. Execution example LOAD "COMO:",R • In regard to a function, FUNCTION is written in front of the function name as follows: EOF (end of file) • An input item inside [ ] in the Format section can be omitted. • The ..” indicates that the input item can be repeatedly specified within the input range per line as follows: INPUT #file number, variable [,variable]. Name of command or function Function Page Command OPEN Opens an RS-232C file". 14 CLOSE Closes the file opened by an OPEN statement. 12 PRINT# Writes data to a transmit buffer file. 15 PRINT#USING Writes data to a transmit buffer file in a specified format. 15 INPUT# Reads data from a receive buffer file, and assigns it to a variable. 13 i LINE INPUT# Reads a string from a receive buffer file, and assigned it to a variable. 13 SAVE Sends a BASIC program to the RS-232C port 21 . 1 17 LOAD Loads a BASIC program from the RS-232C port. 13 i ^The file is the specified buffer area which is used as a receive/ transmit buffer for the RS-232C communication. 2, The RS-232C port number is specified to the RS-232C interface as follows. 0: • RS-232C interface on the MSX computer • RS-232C interface on the RS-232C interface cartridge which is first inserted into the computer’s slot when the MSX computer has no resident RS-232C interface. 1-4: Port number increases one by one as an RS-232C interface is added to the MSX computer using the RS-232C interface cartridge, for example. Name of command or function Function Page Command RUN Loads a program from the RS- 232C port and executes the program. 17 MERGE Loads a program in ASCII format from the RS-232C port, and merges it into the program currently in memory. 14 Function EOF When the last data of a file has been read, -1 is given, otherwise 0 is given. 12 INPUTS Inputs a specified number of characters from the receive buffer file. 12 LOC Returns the number of characters in the receive buffer file. 14 LOF Returns the free space remaining in the receive buffer file. 14 11 - Function [EOF (end of file)! Name of the commands Function Page COMINI Initializes the communication mode. 18 COMTERM Sets the MSX computer in the terminal mode. 20 COMDTR Sets the ER (DTR) signal to ON/OFF. 18 COMBREAK Sends the break sequence. 17 COMSTAT Reads the RS-232C port status. 19 COM GOSUB Declares a subroutine to which program branches when an interrupt occurs from the RS-232C port. 17 COMON Enables the interrupt from the RS-232C port. 19 COMOFF Disables the interrupt from the RS-232C port. 19 COM STOP Suspends the interrupt from the RS-232C port. 19 The above extended commands are executed with the CALL (-) statement. 3-1-3 MSX-BASIC COMMANDS AND FUNCTIONS MSX-BASIC commands and functions used for RS-232C communi¬ cation. ICLOSE (close)| Closes a file opened by an OPEN statement. When the last data of a file has been read, -1 is given, otherwise 0 is given. FORMAT EOF (file number) File number Integer constants, variables, array variables, their expressions, 1 ^ file number £ the number specified by MAXFlLES = statement Given value: Integer type (-1 or 0) FUNCTION AND UTILIZATION The file is the one opened as a receive buffer by the OPEN statement. This function checks if the EOF code (1 AH) which indicates the end of data is received in the receive buffer file or not. If -1 is given, EOF code is received, otherwise 0 is given. Execution example IF EOF(1) THEN CLOSE When the last data is read while data is be.ing read from the receive buffer whose file number is 1, the file is closed by the above state¬ ment. IINPUTS (input dollar)| Inputs a specified number of characters from a receive buffer file. FORMAT CLOSE [#] [file number] [.file number]. File number Integer constants, 1 % file number £ the number specified by MAXFlLES = statement KSfiiQI Closes all the files. FUNCTION AND UTILIZATION The file number has to be the one assigned to the file opened with the OPEN statement. The file number of the file closed can be used again when opening a new file. If the file closed is a transmit buffer file, an EOF code (1AH) will be sent to the connected device. • The opened files will also be closed by the RUN, END, CLEAR, or NEW commands. Execution example close #i , 2,3 The files numbered 1,2, and 3 are all closed. FORMAT INPUTS (X, [#] file number) X B2EE1 Numeric type constants, variables, array variables, their expression, 1 ^ X <256 File number Integer constants, 1 ^ file number ^ the number specified by MAXFILE = statement FUNCTION AND UTILIZATION Reads number of characters (string type data) specified by X from the RS-232C receive burffer file. The file number should be the one assigned to the file opened by the OPEN statement as a receive buffer. Execution example 10 OPEN "COMO:" FOR INPUT AS #1 20 X$-INPUT$(50,^1 ) 30 CLOSE Opens an RS-232C receive buffer file with the file number 1, inputs 50 characters from the file, and then closes the file. Range of “X” During initial status, if X is outside the range from 1 to 200, an error occurs. When the size of the character area is set to more than 255 by a CLEAR statement, a value from 1 to 255 can be selected. - 12 - II N PUT# (input number)| Reads data from a receive buffer file, and assigns it to a variable. FORMAT INPUT# file number, variable [.variable]. File number ISSI Integer constants, 1 ^ file number ^ the number specified by MAXFILES = statement Variable PEBB1 Numeric type or string type, their array variables FUNCTION AND UTILIZATION Reads data from the receive buffer file. The file number has to be the one assigned to the file opened by the OPEN statement as a receive buffer. If the data is numeric type, spaces, return codes, and line feed codes before the data are ignored. If the data is string type, the data from the first character to the character before a space, comma, return code, or line feed code is read as one data. If the characters are inside “ ”, only these characters are read as data. To specify the variables, be sure to assign the type of variables appro¬ priate for the data to be read as follows: ex.) “ABCDEFG”-A$ (string type variable) 1,2,3,4,5-A% (numeric type variable) Execution example 10 OPEN "COMO:" FOR INPUT AS #1 20 IF EOF{1) THEN GOTO 50 30 INPUT #1,A$:PRINT A$ 40 GOTO 20 50 CLOSE Opens a receive buffer file numbered 1, reads string type data from the file, and assigns the data to the variable AS while displaying it on the screen. If the EOF code is received (the last data has been read), the file is closed. ILINE INPUT# (line input number)! Reads a string from a receive buffer file, and assign it to a variable. FUNCTION AND UTILIZATION Reads string type data from the RS-232C receive buffer file. However, a space, comma, and line feed codes are not considered as pun¬ ctuation for the data string, which differs from the INPUT# statement. The character string including those items is assinged to a variable as character string data. Only the return code is considered to be punctu¬ ation for data. Up to 254 characters can be read from the file. Execution example 10 OPEN "COMO;" FOR INPUT AS #1 -20 IF EOF (1 ) THEN GOTO 60 30 LINE INPUT #1,A$ 40 PRINT A$ 50 GOTO 20 60 CLOSE :END Opens an RS-232C receive buffer file with the file number 1, reads string data from the file, and assings the data to the string type variable A$. The contents of the data is displayed on the screen. If end of data character is received, the file numbered 1 is closed. LOAD (load) Loads a BASIC program from the RS-232C port. FORMAT LOAD “COM [port number] :”[,R] Port number Integer type constants, 0 S port number ^ 4 B3D Q R IHjjfll Loading the program only FUNCTION AND UTILIZATION A LOAD statement closes all opened files and deletes the current pro¬ gram from memory, then loads a BASIC program in the ASCII format into memory from the specified port. If the “R” option is specified, however, all data files remain open and the program that is loaded is automatically executed. Upon receipt of the EOF code (1AH), the program loading will end. Execution example LOAD "COM0:",R FORMAT LINE INPUT # file number, variable File number Integer constants, 1 ^ file number ^ the number specified by MAXFILES= statement Variable String type variables, array variables - 13 - Function LOC (location) | (MERGE (merge)| Returns the number of characters in the receive buffer file. Loads a program in ASCII format from the RS-232C port, and merges it into the program currently in memory. FORMAT LOC (file number) File number Q32EB Numeric constants, variables, array variables, their expressions, 1 ^ file number <[ the number specified in MAXFILES = statement FUNCTION AND UTILIZATION The file number should be the one assinged to the file opened by the OPEN statement as a receive buffer. The size of the RS-232C receive buffer is 128 charcters max. Function LOF (length of file) Returns the free space remaining in the receive buffer file. FORMAT LOF (file number) File number M.I.I.I Numeric constants, variables, array variables, their expressions, 1 ^ file number ^ the number specified by the MAXFILES = statement Given value: Integer type FUNCTION AND UTILIZATION Returns the size of the free space remaining in the receive buffer by the number of characters. The file number should be the one assigned to the file opened by the OPEN statement as a receive buffer. FORMAT MERGE “COM [port number]:” Port number Integer type constants, 0 5 port number S 4 MHH1 0 Given value: Integer type FUNCTION AND UTILIZATION If some of the line numbers of the program in memory match line numbers of the program incoming from the RS-232C port, the lines of the program from the RS-232C port replaces the matching lines of the program currently in memory. After the MERGE command executed, the merged program will reside in memory, and control will return to BASIC at the command level. Execution example MERGE "COMO:" Loads lines of the program from the RS-232C port numbered 0, and merges them with the program in memory. OPEN (open)| Opens an RS-232C file. FORMAT OPEN “COM [port number]:” [FOR mode] AS [#] file number Port number Integer type constants, 0 ^ port number ^ 4 lana o Mode BEfiEl OUTPUT, INPUT Bfffll OUTPUT/INPUT File number LiLliU Integer constants, 1 ^ file number £ the number specified by MAXFILES = statement FUNCTION AND UTILIZATION Allocates an I/O buffer which will be used as a transmit or receive buffer for RS-232C communication. The buffer allocated is called a file. The transmit buffer file will be opened if OUTPUT is specified as the mode, and the receive buffer file will be opened if INPUT as the mode. If “mode” is not specified, and no EOF (end-of-file) code handl¬ ing is done, the RS-232C port can be accessed for both transmitting and receiving data. An OPEN statement must be executed before the following state¬ ments using the RS-232C files: PRINT#, PRINT# USING, INPUT#, LINE INPUT#, INPUT$ Execution example OPEN "COMO:" FOR OUTPUT AS Opens RS-232C transmit buffer with the file number 1. - 14 - PRINT# (print number) Writes data to an RS-232C transmit buffer file. IPRINT # USING (print number usingl Writes data to a transmit buffer file in a specified format. FORMAT PRINT # file number, expression [separator] [expression]. File number Integer constants, 1 ^ file number ^ the number specified by MAXFILES = statement Expression String type and numeric type constansts, variables, _ array variables, their expressions Separator QQ] Comma (,) or semicolon (;) FUNCTION AND UTILIZATION The file is the one opened by the OPEN statement as a transmit buffer. Numeric type constants, numeric type and string type variables are written as they are, and string type constants are written inside quotation marks {“ ”). Separator function When data is punctuated with a comma (,), spaces are inserted between the data by a 14-digit tab function, and when it is punctuated with a semicolon (;), it is followed by the next data. If a separator is not written at the end, return code and line feed code will be output. Numeric data and signs In regard to signs that indicate positive or negative, “ + ” is omitted while sign is transmitted. Execution example 10 OPEN "COMO:" FOR OUTPUT AS #1 20 A$-"ABC":B£-"DEF" 30 PRINT , A±;B& 40 PRINT #1,A$,B$ 50 PRINT +50,-50 60 CLOSE Using the above program, data will be transmitted in the following format: ABCDEF |Line feed code] 11 spaces 10 spaces _. n - ;- :— — 1 ABC 11 spaces — DEF 10 spaces |Line feed code| _, r~, -:— - -vi T 50 ' -50 "" |Line feed code[ A space FORMAT PRINT # file number [JSING format symbol; expression [.expression]. File number HlliU Integer constants, 1 ^ file number S the number specified by MAXFILES = statement Expression isiltil String type and numeric type constants, variables, array variables, their expressions FUNCTION AND UTILIZATION Writes data specified by the expression in a specified format to a transmit buffer file, and then the data will be transmitted from the port. The file should be the one opened by the OPEN statement as a transmit buffer file. The value of an expression is displayed in a format specified by a format symbol as follows: Symbol Expression format and Execution example “ j ” Outputs the first 1 character. PRINT #1 USING "I";"United","Nation" Data to be transmitted -*■ un T n spaces Outputs n + 2 characters. When data is smaller than n + 2 characters, inserts spaces for the residual characters. PRINT #1 USING "\ \" ; "ABCDEF" , "GHI" , "JKLM" Data to be transmitted — abcdghi jklm Outputs all character string. 10 OPEN "COMO:" FOR OUTPUT AS #1 20 A$-"North":B$-"South" 30 PRINT #1 USING "&Pole";A$,B$ 40 CLOSE Data to be transmitted -»■ North Pole South Pole - 15 - “ # Writes # by the number of numeral digits to be transmitted. Decimal point is “ . PRINT #1 USING "POINT:###.#";123.4 Data to be transmitted — point: i 23.4 • When the number of integer digits is less than the specified # number, transmitted data is preceded by spaces, and if it is more, “%” is added before the data. 10 OPEN "COMO:" FOR OUTPUT AS #1 20 PRINT #1 USING "####";12 30 PRINT #1 USING "####";12345 40 CLOSE #1 Data to be transmitted 2345 A 2 LINE FEED CODE ^space • When the number of digits in a fraction of numeric data is smaller than the specified # number, “0” is added, and when it is larger, it is rounded to the nearest whole number. 10 OPEN "COMO:" FOR OUTPUT AS #1 20 PRINT #1 USING "##.##";25.3 30 PRINT #1 USING "##.##";25.345 40 CLOSE #1 Data to be transmitted — 25.30 lLine~~Feed Code! 25.35 The “ + " sign of numeric data is ignored and the ,,LJ ” sign is counted as one digit. 10 OPEN "COMO:" FOR OUTPUT AS #1 20 PRINT #1 USING "###";+123 30 PRINT #1 USING "###";-123 40 CLOSE #1 Data to be transmitted — 123 [Line Feed Code fc-123 “ + ” is added if it is a positive numeral, and is added if it is a negative numeral before or after the numeric data. 10 OPEN "COMO:" FOR OUTPUT AS #1 20 PRINT #1 USING "+####";123,-123 30 PRINT #1 USING "####+";123,-123 Data to be transmitted —123 -1 23 |Line Feed Code! 123+ 123- is added after negative numeric data. PRINT #1 USING "###-";123,-123 Data to be transmitted — 1 23 1 23- “ * *” The space before numeric data is filled with One in the format expresses one digit. 10 OPEN "COMO;" FOR OUTPUT AS #1 20 PRINT #1 USING "**######";123 30 PRINT #1 USING "**######";-234 40 CLOSE #1 Data to be transmitted — *****1 23 |Line Feed Code!****-234 “££” Adds “£” before numeric data. One ‘‘£” in the format is counted as one digit. 10 OPEN "COMO:" FOR OUTPUT AS #1 20 PRINT #1 USING "££###”;1234 30 PRINT #1 USING "+££###";-1234 40 CLOSE #1 Data to be transmitted — £1 234 |Line Feed Code | -£1234 “ * *£” Adds “£” just before the numeric data, and the space before that is filled with “ *” PRINT #1 USING "**£###.##";12.3 4 Data to be transmitted — ***£12.34 When this is specified somewhere before the decimal point, data is transmitted by the insertion of commas between each 3 digits to the left of the decimal point. PRINT #1 USING "#,######.##";12345.67 Data to be transmitted — ^12,345.67 “ A A A A ” Transmit numeric data by floating point type format. “ a a a a ” corresponds to the digits for the exponent part. PRINT #1 USING "##.## " ; 23 4.56 Data to be transmitted — uj2.35E+02 - 16 - Extended MSX BASIC commands for RS-232C communication IRUN (run)N Loads a program from the RS-232C port, and executes the program. FORMAT RUN “COM [port number]:” [,R] Port number HBI Integer type constants, _ 0 ^ port number £ 4 mum o R PffiTTl All data files are closed. FUNCTION AND UTILIZATION Loads a program in ASCII format from the RS-232C port, and upon receipt of the EOF code (1AH), stops loading the program and executes it. The RUN command closes all opened files and deletes the current contents of memory before loading the designated program. When the "R” option is specified, however, all data files remain opened. Execution example RUN "COMO:",R Loads a program from the RS-232C port numbered 0, and executes the loaded program. The all data files remain opened, and no memory con¬ tents will be erased by this command. WM9KSAVE (save) u Sends a BASIC program to the RS-232C port. FORMAT SAVE “COM [port number]:” Port number Intergers type constants, _ 0 S port number 4 0 COM GOSUB Declares a subroutine to which program branches when an interrupt occurs from the RS-232C port. FORMAT CALL COM ([Port number:], GOSUB start line number) Port number ^^3 Integer type constants, _ 0 ^ port number £ 4 limn o Start line number Integer constants, 0 <; number £ 65529 FUNCTION AND UTILIZATION Sets the starting line number of a subroutine to trap when the first character is received after CALL COMON (see page 58) is executed. If another interrupt occurs while the subroutine, the interrupt will be su¬ spended because CALL COMSTOP is automatically executed. Append the RETURN statement at the end of the interrupt service rou¬ tine so that program execution will return to a location next to the CALL COM GOSUB after completing the, subroutine. The RETURN statement automatically executes CALL COMON to enable interrupt from the RS-232C port unless CALL COMOFF has been explicitly ex¬ ecuted inside the subroutine. Note: Interrupt does not take place when MSX-BASIC is not executing a program. When an error trap (resulting from an ON ERROR statement) takes place, it automatically disables all event trappings (including ERROR, STRIG, STOP, SPRITE, INTERVAL and KEY). Execution example CALL COM(,GOSUB 1000) Specifies the line 1000 as the start line of the subroutine which is executed when a character is input from the RS-232C port number 0. FUNCTION AND UTILIZATION Sends an MSX-BASIC program to the specified RS-232C port, and the program will be transmitted in ASCII format from the port. When the transmission of data is completed, the EOF code (IAHj will be sent at the end of the data. I COMBREAK (communication break) | Sends break sequence. Execution example SAVE "COMO;" FORMAT CALL COMBREAK ( [“port number:”], expression) Port number Integer type constants, _ 0 S port number < 4 Expression QQQ Numeric type constants, variables, array variables, their expression, 3 expression ^ 32767 FUNCTION AND UTILIZATION Sends break sequence to the specified RS-232C port by the number of characters specified by the “expression”. All transmit data will be 0 by sending the break sequence, which in¬ dicate that transmission is suspended. Execution example CALL COMBREAK(,20) The 20 break characters will be sent to the RS-232C port number 0. - 17 - COMDTR Sets the ER (DTR) signal to ON/OFF. FORMAT CALL COMDTR ([“port number:’’], expression) Port number^^J Integer type constants, ___ 0 S port number S 4 FUNCTION AND UTILIZATION For details of the data format and the communication modes, read the “1-3-2 SETTING THE RS-232C DATA FORMAT AND COMMUNI¬ CATION MODE.” At the computer’s power-on, CALL COMINI will automatically be executed with the initial settings as shown below. Only when you need to change those initial settings, execute CALL COMINI. The contents of the "data string expression” consists of a value for data length, parity, stop bit, and so forth. Define the value of the data string expression according the following format: Expression IsfcUJ Numeric type constants, variables, array variables, their expression FUNCTION AND UTILIZATION Turns off the ER (DTR) signal when the value of “expression” is 0, otherwise turns on the ER signal. At the computer’s power-on, the ER signal is ON. Execution example CALL COMDTR(,0) [0:] [8 [N [1 [X [H [N [N [N] ] ] ] ] ] ] .I RS-232C port number- 0* to 4 Shift-in/Shift-out control S: Enables control N: Disables control * Data length — 5: 5 bits 6 : 6 bits 7: 7 bits 8 : 8 bits* L Automatic LF code delete (when transmitting) A: Deletes LF code N: Not delete LF code*^ The ER (DTR) signal from the RS-232C port 0 will be turned off. COMINI (communication initialize)! Parity check- E: Even parity O: Odd parity I: Ignore parity N: No parity* Initializes the communication mode. FORMAT CALL COMINI ([“data string expression”] [.receive baud rate] [.transmit baud rate] [.time out] Length of stop bits 1 : 1 bit* 2: 1.5 bits 3: 2 bits I-Automatic LF code insert (when receiving) A: Inserts LF code N: Not insert LF code* --CS-RS handshake H: Handshaking* N: No handshaking -XON/XOFF control X: Enables control * N: Disables control Data string QBQ String type constants, variables, array variables, and their expression ESDI “0:8N1XHNNN” . Receive baud rate |&IiU Numeric type constants, variables, array variables, and their expression, 50 ^ Receive _ baud rate ^ 1200 ISCSI 1200 Transmit baud rateQ^I Numeric type constants, variables ; array variables, and their expression, 50 ^ Transmit _ baud rate ^ 1200 the same baud rate as the receive baud rate Time out IstLU Numeric type constants, variables, array variables, and their expression 0 £ time out fS 255 0 * Initial settings As for the “transmit/receive speed”, it is possible to set a different baud rate (speed) for data transmission and data reception. Execution example CALL COMINI("0:BE") Even parity is newly set instead of the initial setting of “no parity.” Items within the (“ ”) can be omitted from the right. CALL COMINI("0:8 3 N",1200) Length of stop bit is set to 2 bits, automatic LF code insert is not set and 1200 baud rate for receiving and transmission with other modes remain at their initial settings. The items within the “ ” can be omitted by spaces in place. • To omit all items in ( ), omit the ( ) together with the items in it. _ 18 - COMONI ICOMSTAT (communication status)! Enables the interrupt from the RS-232C port. Reads the RS-232C port status. FORMAT CALL COMON ([“port number:”]) Port number SstSZsB Integer type constants, ____ 0 S port number ^ 4 Q FUNCTION AND UTILIZATION Enables interrupt caused by incoming characters from the specified RS-232C port. If the starting line number of the subroutine is specified with the CALL COM GOSUB statement, the subroutine will be executed. COMOFF Disables the interrupt from the RS-232C port. FORMAT CALL COMOFF ([“port number:”]) Port number[*ms| Integer type constants, _ 0 £ port number ^ 4 EE3D FUNCTION AND UTILIZATION Disables interrupt caused by incoming character from the specified RS-232C port. After this statement is executed, the interrupt will not take place even if there is an interrupt request from the RS-232C port. FORMAT CALL COMSTAT ([“port number:”], variable) Port niimhar EEfiEl Integer type constants, 0 <| port number ^ 4 Variable Ifi&Uifl Numeric type variables, array variables FUNCTION AND UTILIZATION Reads the status of the specified RS-232C port. The status is returned in numeric data, and it is assigned to the variable. The bit assignments of the numeric data, if its binary expression is given, are as follows: MSB bit 15 Receive buffer overflow error (Data is transmitted when the buffer is full.) 0: No error 1: Error occurred bit 14 Time out error (The specified time has elasped since the CS signal had been OFF.) 0: No error 1: Error occurred bit 13 Framing error (The binary “0” bit has been received instead of the stop bit.) 0: No error 1: Error occurred bit 12 Overrun error (Next data is received before reading the last data from the receive buffer file.) 0: No error 1: Error occurred COMSTOPi bit 11 Parity error (see page 6) 0: No error 1: Error occurred Suspends the interrupt from the RS-232C port. FORMAT CALL COMSTOP ([“port number:”]) port number |*[j|]J Integer type constatns, 0 <[ port number 4 FUNCTION AND UTILIZATION Suspends the interrupt request by incoming characters from the RS- 232C port until the CALL COMON statement is executed. bit 10 Control break key ( [CTRLl + jSTOPl keys) was pressed 0: Not pressed 1 : Pressed bit 9 Reserved: 0 bit 8 Reserved: 0 bit 7 CS (CTS) signal status 0: OFF 1: ON bit 6 Timer/counter set for the time out error detection 0: Not set 1: Set bit 5 Reserved: 0 bit 4 Reserved: 0 bit 3 DR (DSR) signal status 0: OFF 1: ON - 19 - bit 2 Break sequence detected since COMSTAT is executed. 0: Not detected 1: Detected bit 1 Reserved: 0 bit 0 CD signal status 0: OFF 1: ON Execution example CALL COMSTAT("0:",A):PRINT BIN$(A) The numeric data of the RS-232C port 0 status is assigned to the numeric type variable “A”, and a binary expression of A is given as string type data. ICOMTERMI Sets the MSX computer in the terminal mode. FORMAT CALL COMTERM [(“port number:”)] Port number JJ Integer type constants, 0 £ port number £ 4 romtl o FUNCTION AND UTILIZATION Enters a terminal emulator mode. Before entering the terminal mode, all the RS-232C files should be closed. The function keys have special use in the terminal mode. For details of the terminal mode and the usage of the function keys, read “Terminal Mode” on page 10. -20- CHAPTER 2 BLOCK DIAGRAM - 22 - Interface connector pin assignment Pin No. Symbol and description Signal flow direction with signal direction select switch TO MODEM TO TERMINAL 1 FG Frame ground - - 2 SD (T x D) Transmit data Output Input 3 RD (R x D) Received data input Output 4 RS (RTS) Request to send Output Input 5- CS (CTS) Clear to send Input ■ Output 6 DR (DSR) Data set ready Input Output 7 SG Signal ground — — 8 CD (DCD) Carrier detection Input Output 20 ER (DTR) Data terminal ready Output input 22 Cl (R!) Ring indicator Input ~ IF-104 I SEMICONDUCTOR PIN ASSIGNMENTS TYPE PAGE 1SI 555 29 2SC641K 29 27128-RS232CHBI232 26 MB8416A-12P-SK 27 SN74ALS133N 27 SN74LS04N 27 SN74LS08N 27 SN74LS10N 27 SN74LS138N 27 SN74LS156N 29 SN74LS32N 27 SN74LS367AN 28 SN74LS74AN 28 SN75188N 28 SN75189AN 28 27128-RS232CHBI232 N-MOS UV EPROM 128K-BIT [16384*8) — TOP VIEW — MPD8251AFC 28 juPD8253C-5 29 1 , TTL LEVEL HIGH VOLTAGE IN 0 , TTL LEVEL LOW VOLTAGE IN X , DON’T CARE O OR 0 ) - 26 - MB841 6A-12P-SK (FUJITSU) (ACCESS TIME = 120 nS) C MOS 1 6384(2048x8)-BIT HIGH SPEED STATIC RAM — TOP VIEW — INPUTS FUNCTION CS WR EN 0 0 X WRITE 0 1 0 READ 0 1 1 DISABLE IOUTPUT=HI-ZI 1 X X DISABLE (OUTPUT = HI-ZI 0;LOW LEVEL 1 ; HIGH LEVEL x; don’t care HI-2; HIGH IMPEDANCE A0-A10 ; ADDRESS INPUTS W/R ; WRITE/READ ENABLE EN ; OUTPUT ENABLE CS ; CHIP SELECT DO -D7 ; DATA INPUTS/OUTPUTS SN74ALS1 33N (Tl) TTL 13-INPUT NAND GATE — TOP VIEW — EiiPsirarforaFirSim Y=A B C D E-F G H I J K-L-M C D E F G SN74LS04N (Tl) TTLINVERTER — TOP VIEW — -M m Fa] r m r^i m U U w hfih. lAj ii iAj iAj iAj iij a-{>-y-a^>-y 0;LOW LEVEL 1 i HIGH LEVEL SN74LS1 ON (Tl) TTL 3-INPUT POSITIVE NAND GATE — TOP VIEW — M.Jfl Vcc >1 — i: M M ho] fsl fel J y drdr tTJl. Lli iAj lil iij LzJ £_§..£ JL 0 0 0 1 0 0 11 0_1__0 £ o_j_j__L i | ° | o 11 TTTTorr HUm 0 I LOW LEVEL 1 : HIGH LEVEL SN74LS1 38N (Tl) TTL 3-TO-8-LINE DECODER/DEMULTIPLEXER — TOP VIEW — EN = EN1 -FU2-EN3 0 ; LOW LEVEL t i HIGH LEVEL X ; don’t care SN74LS32N (Tl) TTL 2-INPUT POSITIVE-OR GATE — TOP VIEW — H W \ fy] rn fj] [j] '^1 Lll l£j lAj L1I lAj l£J LZJ a I b I y £ 0.0 0 1 1 1 0 1 OiLOW LEVEL i ;high level SN74LS08N (Tl) TTL 2-INPUT POSITIVE-AND GATE — TOP VIEW — [14] [13] fl2] [HI [ip] [9] fel IJd-J AB Y 0_0_0_ £ J_£ j__o low level 1 11 11 [ 1 ; HIGH LEVEL 27 SN74LS367AN (Tt) TTL BUS DRIVER WITH 3-STATE OUTPUTS — TOP VIEW — UPD8251AFC (NEC} N-MOS PROGRAMMABLE COMMUNICATION INTERFACE — TOP VIEW — £ V f IV 1 A ^ liflUliJlAJliJliJlzJlaj ^1 U =5- Im-z o;low level 1 : HIGH LEVEL X;OONT CARE Hl-Z ;HIGH IMPEDANCE SN74LS74AN (Tl) TTL D-TYPE FLIP FLOP WITH DIRECT SET/RESET — TOP VIEW — ,1 i I GND | lii Lli Lll LU Lll 111 1ZJ | INPUTS lOUTPUTS| SO RD CK D Qn-H Qn+1 0 1 X X 1 0 1 0 X 0 1 0 0 X 1 1* 1 * 1 1 X 1 0 T T ,_r IT 0 1 i 0_ T Qn Qn LOW LEVEL HIGH LEVEL DON'T CARE NONSTABLE SN75188N (Tl) 2-INPUT (1 -INPUT) POSITIVE-NAND LINE DRIVER — TOP VIEW - IhI [iil lizl H |iol l~9l [si b^D^' |jJ [2j 13J [lJ [5j [6j LZJ Y = A-B = o|o 0;L0W LEVEL 1: HIGH LEVEL SN75189AN (Tl) QUADRUPLE LINE RECEIVER — TOP VIEW — DZ i/o[T D3 l/o[F RxDin|T k‘ D4 l/o[T D5 l/o[F D6 l/0[7 D7 l/o[j[ fiTC .n[9 wrin[io csin^T C/D in (l2 RED in[l3 Rx RDY OUT ^4 28j D1 I/O 27] DO I/O il »] rTcin 24] DTR OUT H) RTS OUT i|]DSRiN S] RESET in CK in is] T x D OUT is] Tx EMPTY OUT 17] CTS IN ie] SYNDET/BD I/O is] TxRDY OUT fi4l [ill lizl FH fiol FI fel . ti rti.» ill i±j ill iAj i±j lii nr INPUT THRESHOLD SHIFTING DOtoD7 C/D RED WR CS CK RESET Tx C Tx D RxC Rx D Rx ROY Tx RDY DSR DTR SYNDET/BP RTS CTS TxEMPTY DATA BUS CONTROL or DATA IS TO BE WRITTEN or READ READ DATA COMMAND WRITE DATA or CONTROL COMMAND CHIP ENABLE CLOCK PULSE RESET TRANSMITTER CLOCK TRANSMTTER DATA RECEIVER CLOCK RECEIVER DATA RECEIVER READY TRANSMITTER READY DATA SET READY DATA TERMINAL READY SYNC DETECT/BREAK DETECT REQUEST TO SEND DATA CLEAR TO SEND DATA TRANSMITTER EMPTY INPUT NOISE FILTERING Cc W - 28 - UPD8253C-5 (NEC) N-MOS PROGRAMABLE INTERVAL TIMER — TOP VIEW — SN74LS1 56N (Tl) TTL DUAL 2-ILNE-TO-4-LINE DECODER/DEMULTIPLEXER (OPEN COLLECTOR OUTPUT) — TOP VIEW — FUNCTION TABLE 0 ; LOW LEVEL 1 ; HIGH LEVEL X; DONT CARE Hl-Z;HIGH IMPEDANCE 3-LINE-TO-0- LINE DECODER OR 1 - LINE-TO-8 - LINE DEMULTIPLEXER 29 - CHAPTER 4 REPAIR PARTS AND FIXTURE 4-1. EXPLODED VIEW No. Parts No. Description 1 2-234-904-00 BUSH, CORD 2 3-701-690-00 LABEL (MADE IN JAPAN) 3 4-606-567-02 PROTECTOR 4 4-606-568-01 SPRING, TORSION 5 4-606-569-02 CASE (REAR), CARTRIDGE 6 4-606-570-02 CASE (FRONT), CARTRIDGE 7 4-609-310-01 LABEL, CARTRIDGE 8 4-608-657-01 COVER, SWITCH 9 1-558-396-11 CORD, CONNECTION 10 4-609-304-01 STOPPER, CABLE NOTE: 1. : ; :o: The shaded and ^-marked components are critical to safety. :: : : Replace only with same components as specified. 2. Parts printed in Bold-Face type are normally stocked for replacement purposes. The remaining parts shown in this manual are not normally required for routine service work. Orders for parts not shown in Bold-Face type will be processed, but allow for additional delivery time. 3. Item with no part number and/or no description are not stocked because they are seldom required for routine service. - 30 - 4-2. ELECTRICAL PARTS LIST Ref. No. Parts No. Description Ref. No. Parts No. Description IF-104 Board IC1 8-759-951-88 SN75188N IC2 8-759-900-04 SN74LS04N Cl 1-102-852-00 CERAMIC 47PF 5% BOV IC3 8 759-900-04 SN74LS04N C2 1-102-515-00 CERAMIC 24PF 5% 50V IC4 8-759-951-89 SN75189AN C4 1-162-561-11 CERAMIC 0.1 16V IC5 8-759-901-38 SN74LS138N C5 1-162-561-11 CERAMIC 0.1 16V C6 1-162-561-11 CERAMIC 0.1 16V IC6 8-759-904-53 SN74ALS133N IC7 8-759-103 27 juPD8251 AFC C7 1-124-236-00 ELECT 47 20% 16V IC8 8-759-182-53 MPD8253C-5 C8 1-102-114-00 CERAMIC 470PF 10% 50 V IC9 8-759-900-32 SN74LS32N C9 1-161-330-00 CERAMIC 0.01 30% 25V IC10 8-759-900-74 SN74LS74AN CIO 1-161-330-00 CERAMIC 0.01 30% 25V C11 1-161-330-00 CERAMIC 0.01 30% 25V IC11 8-759-900-10 SN74LSION IC12 8-759-903-67 SN74 LS367AN C12 1-161-330-00 CERAMIC 0.01 30% 25V IC13 8-759-767-64 27128-RS232CHB1232 C13 1-161-330-00 CERAMIC 0.01 30% 25V IC14 8-759-900-32 SN74LS32N C14 1-161-330-00 CERAMIC 0.01 30% 25V IC15 8-759-900-32 SN74LS32N C15 1-161-330-00 CERAMIC 0.01 30% 25V C16 1-161-330-00 CERAMIC 0.01 30% 25V IC16 8-759-900-74 SN74LS74AN IC17 8-759-911-92 MB8416A-12P-SK C17 1-161-330-00 CERAMIC 0.01 30% 25V IC18 8-759-901-56 SN74LS156N C18 1-161-330-00 CERAMIC 0.01 30% 25V IC19 8-759-900-08 SN74LS08N C19 1-161-330-00 CERAMIC 0.01 30% 25V C20 1-161-330-00 CERAMIC 0.01 30% 25V C21 1-161-330-00 CERAMIC 0.01 30% 25V Q1 8-729-364-12 2SC641K C22 1-161-330-00 CERAMIC 0.01 30% 25V C23 1-161-330-00 CERAMIC 0.01 30% 25V R1 1-247-145-00 CARBON 3.9K 5% 1/4W R2 1-247-725-11 CARBON 10K 5% 1/4W CN1 1-564-009-00 PIN, CONNECTOR 1 OP R3 1-247-137-00 CARBON 1.8K 5% 1/4W R4 1-247-704-11 CARBON 220 5% 1/4W R5 1-247-137-00 CARBON 1.8K 5% 1/4W D1 8-719-815-55 1SI555 R6 1-247-855-00 CARBON 10K 5% 1/6W D2 8-719*815-55 1 SI 555 FBI FB2 FB3 1-543-255-11 1-543-255-11 1-543-255-11 BEAD, FERRITE BEAD, FERRITE BEAD, FERRITE SI 1-554-949-11 SWITCH, SLIDE FB4 FB5 1-543-255-11 1-543-255-11 BEAD, FERRITE BEAD, FERRITE XI 1-567-483-11 VIBRATOR, CRYSTAL 3.684MHz FB6 1-543-255-11 BEAD, FERRITE FB7 1-543-255-11 BEAD, FERRITE FB8 1-543-255-11 BEAD, FERRITE FB9 1-543-255-11 BEAD, FERRITE FB10 1-543-255-11 BEAD, FERRITE FB11 1-543-255-11 BEAD, FERRITE FB12 1-543-255-11 BEAD, FERRITE NOTE: 1. The shaded and ^-marked components are critical to safety. Replace only with same components as specified. 4-3. PACKING MATERIAL AND ACCESSORY Parts No. Description X-4604-452-1 SCREW ASSY, CONNECTOR 3-701-625-00 BAG,POLYETHYLENE 3-760-996-11 MANUAL, INSTRUCTION 3-764-312-12 MANUAL, RS-232C 4-609-359-11 INDIVIDUAL CARTON 4-608-630-01 CUSHION 4-608-631-01 SPACER 2. Parts printed in Bold-Face type are normally stocked for replacement purposes. The remaining parts shown in this manual are not normally required for routine service work. Orders for parts not shown in Bold-Face type will be processed, but allow for additional delivery time. 31