CN102142951A - Reversing control structure of RS485 transceiver chip and control method thereof - Google Patents

Reversing control structure of RS485 transceiver chip and control method thereof Download PDF

Info

Publication number
CN102142951A
CN102142951A CN2011100027053A CN201110002705A CN102142951A CN 102142951 A CN102142951 A CN 102142951A CN 2011100027053 A CN2011100027053 A CN 2011100027053A CN 201110002705 A CN201110002705 A CN 201110002705A CN 102142951 A CN102142951 A CN 102142951A
Authority
CN
China
Prior art keywords
baud rate
commutation control
module
signal
counter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011100027053A
Other languages
Chinese (zh)
Inventor
戴林
闻海忠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Tiandy Digital Technology Co Ltd
Original Assignee
Tianjin Tiandy Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianjin Tiandy Digital Technology Co Ltd filed Critical Tianjin Tiandy Digital Technology Co Ltd
Priority to CN2011100027053A priority Critical patent/CN102142951A/en
Publication of CN102142951A publication Critical patent/CN102142951A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

The invention discloses a reversing control structure of an RS485 transceiver chip, comprising a prescaling module, a baud rate setting interface module and a reversing control module, wherein the prescaling module provides different scaling signals for the baud rate; the baud rate of the baud rate setting interface module is independently set by a user; the reversing control module is selected by the baud rate setting interface module and is controlled by a counting enable signal; the above reversing control structure is realized on the basis of complex programmable logic device (CPLD). The reversing control method of the RS485 transceiver chip is characterized in that reliable reversing control is provided for the RS485 transceiver chip according to the baud rate set by the user, and the reversing control method is suitable for different baud rates and can automatically change according to different baud rates so as to reduce the problem that wrong codes are sent or returned codes are not received in time.

Description

The commutation control structure and the control method of RS485 transponder chip
Technical field
The present invention relates to the technical field of RS485 commutation control, is a kind of based on commutation control structure and control method the CPLD realization, that the RS485 transponder chip of reliable commutation control can be provided according to the baud rate that the user is provided with specifically.
Background technology
Extensive use of RS485 technology and security protection industry are used to carry out Equipment Control and information gathering, and its biggest advantage is that wiring is simple on the engineering, only can realize the transmitting-receiving of data by two lines.Because RS485 is a kind of half-duplex technology, and does not have for it defines a kind of complete upper strata receiving and dispatching mechanism, control need commutate to the transmitting-receiving of RS485 when equipment room carries out both-way communication.Traditional RS485 reverse flow technique comprises following several: program commutation, based on the automatic reverse of inverter, based on the automatic reverse of R-S trigger.
The program commutation is a RS485 reverse flow technique with the most use in the main control device, and its method is the reiving/transmitting state by the program control RS485 transceiver of main control device.Because main control device is the initiator of RS485 communication often, can control reliably the transmitting-receiving of RS485 bus.The great advantage of program commutation is simple, does not need to increase external circuit, is used to not have under the simple program environment of operating system very reliable.But its shortcoming is that this technology is not suitable under the multithreading running environment of operating system, and the service routine commutation can increase the embedded program development difficulty under this environment, increases program development personnel's burden greatly.
Automatic reverse know-why based on inverter is: carry out inversion operation as the transmitting-receiving control signal sending signal, and the A of RS485 bus, B line add respectively, pull down resistor.When sending signal when low, the transmitting-receiving control signal is a high level, makes the RS485 transponder chip be in transmit status, sends being in low level transmission signal; When to send signal be high, transmitting-receiving control signal was a low level, makes the RS485 transponder chip be in receive status, but the upper and lower resistance that draws on the RS485 bus can make bus be in the state of " height ".The advantage of this technology is that circuit simply and not needs program control, but it is poor that shortcoming is a driving force, because the RS485 transponder chip is in accepting state when sending high level, only provide driving, so transmission range does not reach the distance of RS485 regulation far away by the upper and lower resistance that draws on the RS485 bus.
Automatic reverse know-why based on the R-S trigger is: adopt the R-S trigger to add charge-discharge circuit as the commutation control circuit, when sending signal when low, charge-discharge circuit can be the electric capacity charging rapidly by diode, and making the R-S trigger be output as high level, the RS485 transponder chip is in transmit status; Become when high when sending signal, charge-discharge circuit can be that electric capacity slowly discharges by high resistance measurement, and this moment, the output of R-S trigger was high level still, has only when capacitor discharge to finish, the output of R-S trigger just can become low level, makes the RS485 transponder chip return accepting state.This technology can guarantee that whole byte can be finished and sends by revising capacitor discharge speed, solved problem based on the automatic reverse technology driving force difference of inverter, but it is relevant with baud rate that the capacitance-resistance of charge-discharge circuit is selected, can not be adapted to various baud rates with a kind of charge-discharge circuit, issue error code or receive back the untimely problem of sign indicating number otherwise appear at maximum conditions easily.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of based on commutation control structure and control method the CPLD realization, that the RS485 transponder chip of reliable commutation control can be provided according to the baud rate that the user is provided with.
The technical scheme that the present invention takes for the technical problem that exists in the solution known technology is:
The commutation control structure of RS485 transponder chip of the present invention comprises: for various baud rates provide the pre-frequency division module of different fractional frequency signals, the baud rate that baud rate independently is set by the user interface module is set, is subjected to baud rate that the commutation control module of the count enable signal control that interface selects is set; Above-mentioned commutation control structure realizes based on CPLD, pre-frequency division module is provided with interface module with baud rate and is connected with the commutation control module respectively, pre-frequency division module receiving system clock signal, and to the different fractional frequency signal of commutation control module transmission baud rate, baud rate is provided with interface module and selects corresponding fractional frequency signal as count enable signal according to the baud rate of user's setting, count enable signal and transmission signal together transfer to the commutation control module, the commutation control module is a counter, produce the commutation control signal by the commutation control module, and this signal is sent to the RS485 transponder chip.
The present invention can also adopt following technical measures:
Above-mentioned pre-frequency division module provides fractional frequency signal for the multi-way reversing control module simultaneously.
Described baud rate is provided with interface module is selected corresponding baud rate simultaneously for the multi-way reversing control module fractional frequency signal.
The reverse control method of RS485 transponder chip of the present invention, concrete steps are as follows:
I, pre-frequency division module provide different fractional frequency signals at different baud rates under unified system clock;
Figure 2011100027053100002DEST_PATH_IMAGE001
I, baud rate are provided with interface module provides baud rate that interface is set, for the commutation control module is carried out the baud rate setting, from the various fractional frequency signals of pre-frequency division module output, select a suitable count enable signal as the commutation control module according to the setting of baud rate;
Figure 222943DEST_PATH_IMAGE002
I, after being provided with certain baud rate, RS485 commutation control module is promptly carried out the commutation control of data transmit-receive according to this baud rate, in start bit that data send, data itself, check digit, the whole process of position of rest, make the RS485 transponder chip be in transmit status, and after sending position of rest, switch to accepting state rapidly;
Figure DEST_PATH_IMAGE003
, the commutation control module is counter, the count enable signal that this counter is subjected to baud rate that the interface selection is set is controlled, originally the value of counter is 0, after sending start bit (low level) on the transmission holding wire, counter begins to add 1 operation, receives that whenever a count enable signal counter just adds 1, when counter overflows when coming back to 0, counter no longer is subjected to the control of count enable signal, till next start bit (low level) occurring on the transmission holding wire; Counter non-0 during, the RS485 commutation control signal of sending is a high level, make the RS485 transponder chip be in transmit status, and when counter is 0, RS485 commutation control signal is a low level, this moment, the RS485 transponder chip was in accepting state, and the transmit status of RS485 transponder chip matched with the duration that is sent out byte;
V, commutation control module receive the transmission signal of UART interface simultaneously, send enable signal thereby produce RS485, flow to the RS485 transponder chip as the commutation control signal.
Advantage and good effect that the present invention has are:
The RS485 automatic reverse technology that baud rate is set of the present invention, adopt CPLD to realize, can be applicable to different baud rates, and can be according to the difference of baud rate and make a change automatically, thereby reduced an error code or received back the untimely problem of sign indicating number, the transmission enable signal of suitable duration is provided for the RS485 transponder chip according to the baud rate of setting, data transmit-receive commutation control stabilization is reliable, can in single CPLD, realize the commutation control of a plurality of RS485, reduced the quantity of RS485 automatic reversing circuit chips, and can put together realization with other Digital Logic, especially be suitable in the embedded system of operating system.
Description of drawings
Accompanying drawing is elaborated as embodiment with the commutation control structure of the RS485 transponder chip of two passages.
Fig. 1 is the structural representation of the commutation control structure of RS485 transponder chip of the present invention;
Fig. 2 is the structural representation of commutation control structure in application of RS485 transponder chip of the present invention.
Embodiment
It is following that the present invention will be described in detail with reference to drawings and Examples.
Fig. 1 is the structural representation of the commutation control structure of RS485 transponder chip of the present invention; Fig. 2 is the structural representation of commutation control structure in application of RS485 transponder chip of the present invention.
As shown in Figure 1 and Figure 2, the commutation control structure of two passage RS485 transponder chips of the present invention is based on that CPLD realizes, comprising: 1 pre-frequency division module; 1 baud rate is provided with interface module; 2 commutation control modules.Pre-frequency division module is provided with interface module with baud rate and is connected with the commutation control module respectively, pre-frequency division module receiving system clock signal, and to the different fractional frequency signal of commutation control module transmission baud rate, baud rate is provided with interface module and selects corresponding fractional frequency signal as count enable signal according to the baud rate of user's setting, count enable signal and transmission signal together transfer to the commutation control module, the commutation control module is a counter, produce the commutation control signal by the commutation control module, and this signal is sent to the RS485 transponder chip.
Pre-frequency division module is under unified system clock, for 6 kinds of baud rates provide different fractional frequency signals.These fractional frequency signals are count enable signal of commutation control module, and baud rate is high more, and the density of count enable signal is high more, thereby it is short more to make the commutation control module finish time of transmission, and count enable signal and baud rate adapt.Pre-frequency division module can be 2 road RS485 commutation unified fractional frequency signal is provided, and not needing provides independent pre-frequency division module for each RS485 bus.
Baud rate is provided with interface module provides parallel baud rate that interface is set, and is that 2 commutation control modules are carried out the baud rate setting.In case after being provided with certain baud rate, RS485 commutation control module is promptly carried out the commutation control of data transmit-receive according to this baud rate, in start bit that data send, data itself, check digit, the whole process of position of rest, make the RS485 transponder chip be in transmit status, and after sending position of rest, switch to accepting state rapidly, guarantee in time, correctly receive return code.The effect that baud rate is provided with interface is: select a suitable counting as the commutation control module to enable from the various fractional frequency signals of pre-frequency division module output according to the setting of baud rate.
2 commutation control module structures are identical, and its main body all is a counter, and the count enable signal that this counter is subjected to baud rate that the interface selection is set is controlled.Originally the value of counter is 0, after sending start bit (low level) on the transmission holding wire, counter begins to add 1 operation, whenever receive that a count enable signal counter just adds 1, when counter overflows when coming back to 0, counter no longer is subjected to the control of count enable signal, after next start bit (low level) occurring on the transmission holding wire.Counter non-0 during, RS485 commutation control signal is a high level, makes the RS485 transponder chip be in transmit status, and when counter is 0, RS485 commutation control signal is a low level, the RS485 transponder chip is in accepting state at this moment.Since count enable signal according to baud rate setting select, the transmit status of RS485 transponder chip just in time matches with the duration that is sent out byte.
Among Fig. 2, microprocessor CPU carries out the baud rate setting by parallel interface to 2 passages in the commutation control structure of two passage RS485 transponder chips, commutation control module 1 and commutation control module 2 receive the transmission signal TXD1 and the TXD2 of 2 UART interfaces respectively, and produce 2 RS485 and send enable signal TXEN1 and TXEN2, give 2 RS485 transponder chips then respectively as the commutation control signal, control the reception of RS485 transponder chip and the commutation of transmit status with this.
The above, it only is preferred embodiment of the present invention, be not that the present invention is done any pro forma restriction, though the present invention with preferred embodiment openly as above, yet, be not in order to limit the present invention, any those skilled in the art, in not breaking away from the technical solution of the present invention scope, certainly can utilize the technology contents of announcement to make a little change or modification, become the equivalent embodiment of equivalent variations, be the content that does not break away from technical solution of the present invention in every case, according to technical spirit of the present invention to any simple modification that above embodiment did, equivalent variations and modification all belong in the scope of technical solution of the present invention.

Claims (4)

1. the commutation control structure of a RS485 transponder chip is characterized in that: comprising: for various baud rates provide the pre-frequency division module of different fractional frequency signals, the baud rate that baud rate independently is set by the user interface module is set, is subjected to baud rate that the commutation control module of the count enable signal control that interface selects is set; Above-mentioned commutation control structure realizes based on CPLD, pre-frequency division module is provided with interface module with baud rate and is connected with the commutation control module respectively, pre-frequency division module receiving system clock signal, and to the different fractional frequency signal of commutation control module transmission baud rate, baud rate is provided with interface module and selects corresponding fractional frequency signal as count enable signal according to the baud rate of user's setting, count enable signal and transmission signal together transfer to the commutation control module, the commutation control module is a counter, produce the commutation control signal by the commutation control module, and this signal is sent to the RS485 transponder chip.
2. according to the commutation control structure of right 1 described RS485 transponder chip, it is characterized in that: pre-frequency division module provides fractional frequency signal for the multi-way reversing control module simultaneously.
3. according to the commutation control structure of right 1 described RS485 transponder chip, it is characterized in that: baud rate is provided with interface module is selected corresponding baud rate simultaneously for the multi-way reversing control module fractional frequency signal.
4. the reverse control method of a RS485 transponder chip, concrete steps are as follows:
I, pre-frequency division module provide different fractional frequency signals at different baud rates under unified system clock;
II, baud rate are provided with interface module provides baud rate that interface is set, for the commutation control module is carried out the baud rate setting, from the various fractional frequency signals of pre-frequency division module output, select a suitable count enable signal as the commutation control module according to the setting of baud rate;
III, after being provided with certain baud rate, RS485 commutation control module is promptly carried out the commutation control of data transmit-receive according to this baud rate, in start bit that data send, data itself, check digit, the whole process of position of rest, make the RS485 transponder chip be in transmit status, and after sending position of rest, switch to accepting state rapidly;
IV, commutation control module are counter, the count enable signal that this counter is subjected to baud rate that the interface selection is set is controlled, originally the value of counter is 0, after sending start bit (low level) on the transmission holding wire, counter begins to add 1 operation, receives that whenever a count enable signal counter just adds 1, when counter overflows when coming back to 0, counter no longer is subjected to the control of count enable signal, till next start bit (low level) occurring on the transmission holding wire; Counter non-0 during, the RS485 commutation control signal of sending is a high level, make the RS485 transponder chip be in transmit status, and when counter is 0, RS485 commutation control signal is a low level, this moment, the RS485 transponder chip was in accepting state, and the transmit status of RS485 transponder chip matched with the duration that is sent out byte;
V, commutation control module receive the transmission signal of UART interface simultaneously, send enable signal thereby produce RS485, flow to the RS485 transponder chip as the commutation control signal.
CN2011100027053A 2011-01-07 2011-01-07 Reversing control structure of RS485 transceiver chip and control method thereof Pending CN102142951A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011100027053A CN102142951A (en) 2011-01-07 2011-01-07 Reversing control structure of RS485 transceiver chip and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011100027053A CN102142951A (en) 2011-01-07 2011-01-07 Reversing control structure of RS485 transceiver chip and control method thereof

Publications (1)

Publication Number Publication Date
CN102142951A true CN102142951A (en) 2011-08-03

Family

ID=44410199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011100027053A Pending CN102142951A (en) 2011-01-07 2011-01-07 Reversing control structure of RS485 transceiver chip and control method thereof

Country Status (1)

Country Link
CN (1) CN102142951A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611545A (en) * 2012-02-28 2012-07-25 中国北车集团大连机车车辆有限公司 Hardware-based RS485 (radio sensing 485) automatic transceiving control method and circuit
CN104158538A (en) * 2014-08-22 2014-11-19 深圳芯邦科技股份有限公司 Baud rate generation method, baud rate generator and communication equipment
CN104317762A (en) * 2014-10-28 2015-01-28 北京四方继保自动化股份有限公司 Method for adaptively controlling transmitting and receiving directions of RS485 chip by aid of FPGA (field programmable gate array)
CN112713910A (en) * 2020-12-30 2021-04-27 重庆芯讯通无线科技有限公司 Method, system, equipment and medium for switching RS485 receiving and transmitting states
CN113872837A (en) * 2020-06-30 2021-12-31 配天机器人技术有限公司 Signal processing method, device and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1649349A (en) * 2005-02-04 2005-08-03 艾默生网络能源系统有限公司 RS485 communication interface conversion device
CN201022204Y (en) * 2007-02-13 2008-02-13 徐震 Automatic flow control device and its application circuit
CN101894090A (en) * 2010-06-13 2010-11-24 昆山五昌新精密电子工业有限公司 RS-485 signal converter capable of automatically adjusting transmitting-receiving order

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1649349A (en) * 2005-02-04 2005-08-03 艾默生网络能源系统有限公司 RS485 communication interface conversion device
CN201022204Y (en) * 2007-02-13 2008-02-13 徐震 Automatic flow control device and its application circuit
CN101894090A (en) * 2010-06-13 2010-11-24 昆山五昌新精密电子工业有限公司 RS-485 signal converter capable of automatically adjusting transmitting-receiving order

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102611545A (en) * 2012-02-28 2012-07-25 中国北车集团大连机车车辆有限公司 Hardware-based RS485 (radio sensing 485) automatic transceiving control method and circuit
CN104158538A (en) * 2014-08-22 2014-11-19 深圳芯邦科技股份有限公司 Baud rate generation method, baud rate generator and communication equipment
CN104158538B (en) * 2014-08-22 2017-04-05 深圳芯邦科技股份有限公司 Baud rate generation method, Baud rate generator and communication equipment
CN104317762A (en) * 2014-10-28 2015-01-28 北京四方继保自动化股份有限公司 Method for adaptively controlling transmitting and receiving directions of RS485 chip by aid of FPGA (field programmable gate array)
CN113872837A (en) * 2020-06-30 2021-12-31 配天机器人技术有限公司 Signal processing method, device and system
CN112713910A (en) * 2020-12-30 2021-04-27 重庆芯讯通无线科技有限公司 Method, system, equipment and medium for switching RS485 receiving and transmitting states

Similar Documents

Publication Publication Date Title
CN102142951A (en) Reversing control structure of RS485 transceiver chip and control method thereof
CN102611545A (en) Hardware-based RS485 (radio sensing 485) automatic transceiving control method and circuit
CN206594657U (en) The serial transceiver controllers of multichannel UART based on bus communication
CN105159194A (en) Switching circuit and switching method for switching data receiving/sending operation of RS-485 serial port
CN104408002A (en) Serial port master-slave communication control system and method
CN101493806B (en) Data-transmission method of communication adapter
CN104317762A (en) Method for adaptively controlling transmitting and receiving directions of RS485 chip by aid of FPGA (field programmable gate array)
CN201259629Y (en) Configurable I/O module for multiple bus interface
CN102970300B (en) A kind of asynchronous communication method
CN103605306A (en) Communication device based on UART communication interface extension
CN203982366U (en) Based on ARM and FPGA serial port device flexibly at a high speed
CN208477514U (en) A kind of SPI of intelligent temperature controller turns the analog circuit of UART
CN206178787U (en) A control circuit for improving RS485 bus data transmission reliability
CN204633766U (en) The multichannel wireless receiving and dispatching communication system of river model test
CN203414788U (en) Novel off-site integrated wireless monitoring device
CN103338031B (en) The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications
CN106227691A (en) A kind of based on the reciprocity bi-directional single-wire serial communication protocol between MCU
CN202939630U (en) CAN bus-based electronic tag
CN202728142U (en) Car-mounted terminal based on combined positioning technology
CN201927018U (en) Automatic wire holder for 2<8N>/2 paths of household appliances capable of realizing output data management through interconnecting lines of serial port
CN102880576B (en) Method for simulating multiple groups of UART interfaces based on STM32F103VE chip
CN101520764A (en) System for directly using serial signal control device
CN206594811U (en) A kind of multi-functional node assignor
CN101882124A (en) RS422/485 double-use signal converter capable of automatically judging connector
CN103606257A (en) Wireless sudden stop control circuit

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110803

WD01 Invention patent application deemed withdrawn after publication