로고

SULSEAM
korean한국어 로그인

자유게시판

What Make Rs485 Cable Don't need You To Know

페이지 정보

profile_image
작성자 Kristan Wicker
댓글 0건 조회 29회 작성일 24-05-30 08:01

본문

We have built sophisticated instruments using the QScreen Controller that operate very reliably using multiple interrupts in addition to the software UART. In these distributed processing networks, a variety of machines and instruments work locally, but communicate and share data or resources with one another globally using a single serial link. RS485 is a balanced serial interface for the transmission of digital data. RS485 is a serial data transmission interface standard that enables communication with sensors attached to the same bus (wires). When the keyword name is received by the Silence() routine running in the slave, the slave QScreen Controller executes RS485Transmit() to send an acknowledgment to the master (which should now be listening to the serial bus to accept the acknowledgment). RS-485 is also used in building automation as the simple bus wiring and long cable length is ideal for joining remote devices. The RS232 - RS422 converter is also often used in older serial devices such as older PLC's and terminal equipment.



Why use a RS232 - RS485 /RS422 converter? If your application requires RS485, use the primary serial port (serial1) for RS485 communications, and use the secondary serial port (Serial 2) to program and debug your application code using the RS232 protocol. The default serial routines used by the onboard kernel assume that full duplex communications are available, so you cannot use the RS485 protocol to program the controller. Moreover, if Serial2 is running full duplex at 4800 baud, any other interrupt service routine that takes longer than 100 µs is likely to cause a problem. For example, at 4800 baud (bits per second), each bit lasts about 200 microseconds (µs), and if communications are full duplex (e.g., if the QScreen Controller echoes each incoming character), then there is a serial interrupt every 100 µs or so. If an interrupt service routine takes longer than 200 µs, then an entire serial bit will be missed, causing a communications error. In the middle of a character, each interrupt service routine takes about 35 µs.



At the end of a received character, the service routine takes about 45 µs. At the start of a transmitted character, the service routine takes about 65 µs. In most cases the times are less than 25 µs which does not pose a problem. In RS232 mode all pins are used for RS232 signals. When this bit is high, the transceiver is in transmit mode. Also, several non-serial interrupts can stack up; if they have higher priority than the serial interrupts, they will be serviced before the Serial2 interrupt routine, and again a serial input or output bit may be lost. If SPIF is set, reading the received data or initiating a new data transfer automatically clears the SPIF bit. Data translation between different machines can be performed with ease, and applications that communicate via the primary serial port can be debugged using the secondary channel. For the QScreen, /SS is not used for SPI communication because it is used to control the direction of the RS485 transceiver; you can use any digital I/O line as a /SS signal.



For those of you interested in the details, here’s how it works: The low-level serial driver routines named Key(), AskKey() and Emit() are revectorable routines that can be redirected to use either of the serial ports. Routines that temporarily disable interrupts for significant periods of time can also interfere with the Serial2 port. Because all of the serial I/O routines on the QScreen Controller are revectorable, it is very easy to change the serial port in use without modifying any high level code. GasLab® runs on Windows XP or higher, rs485 cable and free to use with our products. If you have not yet compiled the GETSTART program and you want to do the exercises here, open GETSTART.C in your TextPad editor, click on the Make Tool, and after the compilation is done, enter Mosaic Terminal by clicking on the terminal icon and use the "Send File" menu item to send GETSTART.DLF to the QScreen Controller. We’ll use code from the GETSTART.C program. Confirm serial port parameters such as baud rate, data bits, and stop bits: Baud rate should be configured according to the connected RS485 device, commonly used rates are 9600 and 115200; Refer to the device manual or contact RS485 device technical support for configuration, especially if set to Modbus mode, confirm if the function code matches.

댓글목록

등록된 댓글이 없습니다.