NAGASAKI Corporation
Step 4: Disabled TXC signal, and the bit 0 of the address of 4 sets “0”
$
Send out one block data (Transmit – the data more than two characters)
Step 1: Enable TXC signal, and the bit 0 of the address of 4 just sets “1”.
Step 2: Send out the data. (Write all data to the 0 of the current COM port address)
Step 3: Wait for the buffer’s data empty. Check transmitter holding register (THRE, bit 5 of
the address of 5), and transmitter shift register (TSRE, bit 6 of the address of
5) are all sets must be “0”.
Step 4: Disabled TXC signal, and the bit 0 of the address of 4 sets “0”
$
Receive data
The RS-485’s operation of receiving data is in the same of the RS-232’s.
$
Basic Language Example
a. Initial 86C450 UART
10
OPEN “COM1:9600,m,8,1”AS #1 LEN=1
20
REM Reset DTR
30
OUT &H3FC, (INP(%H3FC) AND &HFA)
40 RETURN
b. Send out one character to COM1
10
REM Enable transmitter by setting DTR ON
20
OUT &H3FC, (INP(&H3FC) OR &H01)
30
REM Send out one character
40
PRINT #1, OUTCHR$
50
REM Check transmitter holding register and shift register
60
IF ((INP(&H3FD) AND &H60) >0) THEN 60
70
REM Disable transmitter by resetting DTR
80
OUT &H3FC, (INP(&H3FC) AND &HEF)
90 RETURN
c. Receive one character from COM1
10
REM Check COM1: receiver buffer
20
IF LOF(1)<256 THEN 70
30
REM Receiver buffer is empty
40 INPSTR$”
50 RETURN
60
REM Read one character from COM1: buffer
70 INPSTR$=INPUT$(1,#1)
80 RETURN
NOTE: The example of the above program is based on COM1 (I/O Address 3F8h). The RS-485
of the
PC104-386L uses COM4. If you want to program it, please refer to the BIOS Setup for
COM4 address setup.
41
Summary of Contents for PC104-386L-2M
Page 10: ...Overview 4 ...
Page 20: ...NAGASAKI Corporation 14 ...
Page 48: ...NAGASAKI Corporation 42 ...