EasyManua.ls Logo

Acrosser Technology AR-B1579 - 8 Programming Rs-485 & Index; Programming Rs-485

Acrosser Technology AR-B1579
61 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AR-B1579 User's Guide
8-1
8. PROGRAMMING RS-485 & INDEX
8.1 PROGRAMMING RS-485
The majority communicative operation of the RS-485 is in the same of the RS-232. When the RS-485 proceeds
the transmission which needs control the TXC signal, and the installing steps are as follows:
Step 1:
Enable TXC
Step 2:
Send out data
Step 3:
Waiting for data empty
Step 4:
Disable TXC
NOTE: Please refer to the section of the “Serial Port” in the chapter “System Control” for the detail description of
the COM port’s register.
(1) Initialize COM port
Step 1:
Initialize COM port in the receiver interrupt mode, and /or transmitter interrupt mode. (All of the
communication protocol buses of the RS-485 are in the same.)
Step 2:
Disable TXC (transmitter control), the bit 0 of the address of offset+4 just sets “0”.
NOTE:
Communicates the AR-B1579 CPU card’s DTR signal with the RS-485’s TXC signal.
(2) Send out one character (Transmit)
Step 1:
Enable TXC signal, and the bit 0 of the address of offset+4 just sets “1”.
Step 2:
Send out the data. (Write this character to the offset+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
offset+5), and transmitter shift register (TSRE, bit 6 of the address of offset+5) are all sets must be “0”.
Step 4:
Disabled TXC signal, and the bit 0 of the address of offset+4 sets “0”
(3) 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 offset+4 just sets “1”.
Step 2:
Send out the data. (Write all data to the offset+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
offset+5), and transmitter shift register (TSRE, bit 6 of the address of offset+5) are all sets must be “0”.
Step 4:
Disabled TXC signal, and the bit 0 of the address of offset+4 sets “0”
(4) Receive data
The RS-485’s operation of receiving data is in the same of the RS-232’s.

Table of Contents