CN104090511B - Circuit and method for achieving non-polar 485 communication - Google Patents
Circuit and method for achieving non-polar 485 communication Download PDFInfo
- Publication number
- CN104090511B CN104090511B CN201410307611.0A CN201410307611A CN104090511B CN 104090511 B CN104090511 B CN 104090511B CN 201410307611 A CN201410307611 A CN 201410307611A CN 104090511 B CN104090511 B CN 104090511B
- Authority
- CN
- China
- Prior art keywords
- master control
- mcu
- receiving terminal
- chip
- control receiving
- 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.)
- Active
Links
Abstract
The invention provides a circuit for achieving non-polar 485 communication. The circuit comprises a polar 485 chip and further comprises an MCU having the serial port polarity setting function. The transmitting end of the polar 485 chip is connected to the first master control receiving end and the second master control receiving end of the MCU, wherein the first master control receiving end is set to have serial port positive polarity, and the second master control receiving end is set to have serial port negative polarity. The receiving end of the polar 485 chip is connected to the master control transmitting end of the MCU. According to the circuit for achieving non-polar 485 communication, non-polar 485 communication is achieved through the polar 485 chip and the MCU having the serial port transceiving inversion function or in the mode that an inverter is connected into the MCU, the cost is not increased, reliability of communication is ensured, and large-scale application and population are facilitated.
Description
Technical field
The present invention relates to the design of 485 telecommunication circuits of electric energy meter, particularly to a kind of electricity realizing nonpolarity 485 communications
Road and method.
Background technology
Commonly used 485 group-net communications of existing electric energy meter, and in the commonly used communication line of unipolarity 485 chip
There is dividing of a, b polarity, thus the unsuccessful problem of the communication reversal connection of a, b end easily occurring and leading in networking construction, sternly
Ghost image rings the efficiency of construction at scene.It is thus desirable to the method being capable of nonpolarity 485 communications.
Nonpolarity 485 methods communicating of realizing at present have following several:
1) realized with 485 chips of 2 pieces of independent outputs that work independently.When outside line sequence can not determine, 2 piece of 485 core
Piece is received and dispatched simultaneously, but the signal that only 1 piece chip receives is correct, and mcu determines that piece wherein correct, is then powered off
That piece of communication mistake, you can no matter realizing how outside line sequence accesses, all can proper communication purpose.
The shortcoming of the program is it is necessary to use 2 piece of 485 chip, and every piece 485 will have protection circuit, increase cloth
Plate suqare, increased cost.
2) realized with 1 piece of non-polar 485 chip.The principle of non-polar 485 chip is the differential electrical by chip internal
Pressure detection is drawn realizing the communication of chip identifying communications pins polarity, then by being serially connected with the identifying poles of communications pins and switching
Pin is positive or reverse.
The shortcoming of the program is, in large-area use, if the quantity of forward and reverse chip is almost equal, and
When sharing one group of (2) 485 order wire, chip internal then cannot judge the polarity of pin, and in large-scale application, and one
, in the case of giving no thought to line sequence, the probability of the positive and negative reciprocity of wiring is again exactly equal for group (2) 485 order wires, therefore this
Plant chip in large-scale application, effect is unsatisfactory.
Content of the invention
In order to provide a kind of method realizing nonpolarity 485 communications of low cost and high reliability, the invention discloses a kind of
Realize the circuit of nonpolarity 485 communications, including polarized 485 chip, also include the mcu with serial ports polarity setting function, its
In, the transmitting terminal of described polarized 485 chip is connected respectively to the first master control reception being set to serial ports positive polarity of described mcu
End and the second master control receiving terminal being set to serial ports negative polarity;The receiving terminal of described polarized 485 chip is connected to described mcu's
Master control transmitting terminal.
Preferably, described transmitting terminal is connected to described first and second master control receiving terminals by coupler respectively, described connects
Receiving end is connected to described master control transmitting terminal by coupler.
The invention also discloses a kind of circuit realizing nonpolarity 485 communications, including polarized 485 chip, also include
Mcu, wherein, the transmitting terminal of described polarized 485 chip is connected to the first master control receiving terminal of described mcu, and passes through first
Reverser is connected to the second master control receiving terminal of described mcu;The receiving terminal of described polarized 485 chip in parallel second anti-
It is connected to the master control transmitting terminal of described mcu to device and switch.
Preferably, described transmitting terminal is connected to described first master control receiving terminal and described first reverse by coupler respectively
Device, described receiving terminal is connected to described second reverser by coupler.
Further, the transmitting-receiving control end of described polarized 485 chip is connected to the master control control end of described mcu.
The invention also discloses a kind of methods realizing nonpolarity 485 communications, comprising: when described 485 chips are to described mcu
During sending signal, described mcu receives the first and second data messages respectively by described first and second master control receiving terminals, and sentences
Whether disconnected described first and/or second data message is correct;When determining, described first data message is correct, then stop described the
The reception of two master control receiving terminals, when determining, described second data message is correct, then stop connecing of described first master control receiving terminal
Receive.
Further, also include: when described mcu is to described 485 chip sending signal, described master control is sent out by described mcu
Sending end is set to serial ports positive polarity, and by described master control transmitting terminal to described 485 chip sending signals;If described first is main
Control receiving terminal receives the answer signal of mistake and described second master control receiving terminal receives correct answer signal, then described
Described master control transmitting terminal is set to serial ports negative polarity and continues sending signal by mcu.
The invention also discloses a kind of methods realizing nonpolarity 485 communications, comprising: when described 485 chips are to described mcu
During sending signal, described mcu receives the first and second data messages respectively by described first and second master control receiving terminals, and sentences
Whether disconnected described first and/or second data message is correct;When determining, described first data message is correct, then stop described the
The reception of two master control receiving terminals, when determining, described second data message is correct, then stop connecing of described first master control receiving terminal
Receive.
Further, also include: when described mcu is to described 485 chip sending signal, described switch is set by described mcu
It is set to closure state, and by described master control transmitting terminal to described 485 chip sending signals;If described first master control receiving terminal
Receive mistake answer signal and described second master control receiving terminal receives correct answer signal, described mcu opens described
Pass is set on line state and continues sending signal.
Preferably, also include: if described first and second master control receiving terminals all receive correct answer signal, sentence
Break as communication abnormality.
Circuit and the method for realizing nonpolarity 485 communications of the present invention, in circuit design, using polarized 485 chip
Connect to mcu with the mcu possessing serial ports transmitting-receiving negative function or by reverser, to realize nonpolarity 485 communications.This electricity
Road and method neither increase cost it is also ensured that the reliability of communication, are easy to large-scale promotion application.
Brief description
Fig. 1 is the electrical block diagram of the circuit first embodiment realizing nonpolarity 485 communications of the present invention;
Fig. 2 is the electrical block diagram of the circuit second embodiment realizing nonpolarity 485 communications of the present invention.
Specific embodiment
With reference to the accompanying drawings and detailed description to the present invention realize nonpolarity 485 communication circuit and method make into
The detailed description of one step, but not as a limitation of the invention.
With reference to Fig. 1, it is that the circuit structure of the circuit first embodiment realizing nonpolarity 485 communications of the present invention is illustrated
Figure.In this first embodiment, circuit includes polarized 485 chip and has the mcu of serial ports polarity setting function.There is string
Mouth polarity arranges the mcu of function, is also to have the mcu that serial ports receives and dispatches negative function.Polarized 485 chip passes through 485 order wires
Connect to acquisition terminal.
There is the mcu of serial ports negative function, can be bl6531, bl6536 chip of company of Belling, or microchip
Chip of part model in the pic24 series of company and pic18 series etc..Polarized rs485 chip, can be company of Belling
Bl3085 family chip or bl1585 family chip, or the max13085 chip of maxim company, or ti company
The chip of other models such as 75lbc184 chip.
The transmitting terminal r pin of polarized 485 chip is connected to the first master control receiving terminal rxd0 and of mcu by optocoupler q1
Two master control receiving terminal rxd1, wherein, the first master control receiving terminal rxd0 is not turned on serial ports negative function, the second master control receiving terminal rxd1
Open serial ports negative function.Transmitting-receiving control end re/de of polarized 485 chip is controlled by the master control that optocoupler q2 is connected to mcu
End 485en.Meanwhile, the receiving terminal d of polarized 485 chip is connected to the master control transmitting terminal txd1 of mcu by optocoupler q3.
Based on the method realizing nonpolarity 485 communications of foregoing circuit it is:
When 485 chips are to mcu sending signal, mcu passes through the first master control receiving terminal rxd0 respectively and the second master control receives
End rxd1 receives the first data message and the second data message respectively, and judges whether data message is correct.If it is determined that to
One data message is correct, and the data that is, the first master control receiving terminal rxd0 receives is correct, then conclude that 485 line sequence is correct, give up mistake
The second data message by mistake, and stop the reception of the second master control receiving terminal rxd1, then mcu completes DRP data reception process.If
Determine the second data message correctly, the data that is, the second master control receiving terminal rxd1 receives is correct, then conclude that 485 line sequence is different
Often, give up the first data message of mistake, and stop the reception of described second master control receiving terminal, then mcu completes data receiver
Process.
When mcu is to 485 chip sending signal, master control transmitting terminal txd1 is set to serial ports positive polarity by mcu, that is, be not turned on
The serial ports negative function of master control transmitting terminal txd1, and by master control transmitting terminal txd1 to 485 chip sending signals.If first is main
Control receiving terminal rxd0 receives correct answer signal and the second master control receiving terminal rxd1 receives wrong answer signal, explanation
Line sequence is correct, then when sending without mcu inside signal carried out reversely still being not turned on master control transmitting terminal txd1 serial ports anti-
To function, mcu continues sending signal until being sent.If the first master control receiving terminal rxd0 receives the answer signal of mistake
And the second master control receiving terminal rxd1 receives correct answer signal, line sequence mistake is described, then needs to carry out during mcu sending signal
Internal reverse, master control transmitting terminal txd1 is set to serial ports negative polarity and continues sending signal until being sent by mcu.If first
Master control receiving terminal rxd0 and the second master control receiving terminal rxd1 all receives correct answer signal, illustrates that communication occurs abnormal, needs
Enter row line investigation.
With reference to Fig. 2, it is that the circuit structure of the circuit second embodiment realizing nonpolarity 485 communications of the present invention is illustrated
Figure.If not using the mcu with serial ports negative function, nonpolarity 485 can also be realized using the method for external phase inverter
Communication.The transmitting terminal r of polarized 485 chip is connected to the first master control receiving terminal rxd0 of mcu by optocoupler q1, and leads to further
Cross the second master control receiving terminal rxd1 that the first reverser n1 is connected to mcu.Transmitting-receiving control end re/de of polarized 485 chip is led to
Cross master control control end 485en that optocoupler q2 is connected to mcu.Meanwhile, the receiving terminal d of polarized 485 chip enters one by optocoupler q3
Step the second reverser n2 in parallel is connected to the master control transmitting terminal txd1 of mcu with switch k.
Based on the method realizing nonpolarity 485 communications of foregoing circuit it is:
When 485 chips are to mcu sending signal, its communication means is consistent with what first embodiment described, herein no longer
Repeat.
When mcu is to 485 chip sending signal, mcu by switch k be set to closure state, that is, so that with master control transmitting terminal
The second reverser n2 that txd1 connects is inoperative, and by master control transmitting terminal txd1 to 485 chip sending signals.If first
Master control receiving terminal rxd0 receives correct answer signal and the second master control receiving terminal rxd1 receives wrong answer signal, says
Open-wire line sequence is correct, then need not carry out reversely by the signal that mcu sends, and that is, or by switch k is set to closure state, mcu continues
Sending signal is until be sent.If the first master control receiving terminal rxd0 receives the answer signal of mistake and the second master control receives
End rxd1 receives correct answer signal, line sequence mistake is described, then needs the signal sending mcu to carry out reversely, mcu will open
Close k and be set on line state so that the second phase inverter n2 carries out to the sending signal of mcu reversely, then proceeding to sending signal straight
To being sent.If the first master control receiving terminal rxd0 and the second master control receiving terminal rxd1 all receives correct answer signal,
Illustrate that communication occurs abnormal, need to investigate into row line.
It is understood that in the case of without departing from present subject matter, can also be received to mcu using other methods
Carry out reversely with the signal sending, thus realizing the purpose of the present invention.Such as, the reverse work(of serial ports can be realized with simulative serial port
Energy.
Circuit and the method for realizing nonpolarity 485 communications of the present invention, in circuit design, using polarized 485 chip
Connect to mcu with the mcu possessing serial ports transmitting-receiving negative function or by reverser, to realize nonpolarity 485 communications.This electricity
Road and method neither increase cost it is also ensured that the reliability of communication, are easy to large-scale promotion application.
Above specific embodiment is only the illustrative embodiments of the present invention it is impossible to be used for limiting the present invention, the present invention
Protection domain be defined by the claims.Those skilled in the art can be in the essence and protection domain of the present invention, to this
Various modifications or equivalent are made in invention, and these modifications or equivalent also should be regarded as being within the scope of the present invention.
Claims (6)
1. a kind of circuit realizing nonpolarity 485 communications, including polarized 485 chip it is characterised in that also including mcu, its
In,
The transmitting terminal of described polarized 485 chip is connected to the first master control receiving terminal of described mcu, and passes through the first reverser
It is connected to the second master control receiving terminal of described mcu;
The master control that the receiving terminal of described polarized 485 chip the second reverser in parallel is connected to described mcu with switch is sent out
Sending end.
2. the circuit realizing nonpolarity 485 communications according to claim 1 is it is characterised in that described transmitting terminal passes through coupling
Clutch is connected to described first master control receiving terminal and described first reverser, and described receiving terminal is connected to described by coupler
Two reversers.
3. the circuit realizing nonpolarity 485 communications according to claim 1 are it is characterised in that described polarized 485 chip
Transmitting-receiving control end be connected to the master control control end of described mcu.
4. a kind of method realizing nonpolarity 485 communications based on the circuit described in claim 1, comprising:
When described 485 chips are to described mcu sending signal, described mcu is by described first master control receiving terminal and the second master control
Receiving terminal receives the first data message and the second data message respectively, and judges described first data message and/or the second data
Whether message is correct;
When determining, described first data message is correct, then stop the reception of described second master control receiving terminal, described when determining
Second data message is correct, then stop the reception of described first master control receiving terminal.
5. the method realizing nonpolarity 485 communications according to claim 4 is it is characterised in that also include: as described mcu
During to described 485 chip sending signal,
Described switch is set to closure state by described mcu, and sends letter by described master control transmitting terminal to described 485 chips
Number;
If described first master control receiving terminal receives the answer signal of mistake and described second master control receiving terminal receives correctly
Answer signal, described mcu by described switch be set on line state continue sending signal.
6. the methods realizing nonpolarity 485 communications according to claim 4 are it is characterised in that also include: if described the
One master control receiving terminal and the second master control receiving terminal all receive correct answer signal, then be judged as communication abnormality.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410307611.0A CN104090511B (en) | 2014-06-30 | 2014-06-30 | Circuit and method for achieving non-polar 485 communication |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410307611.0A CN104090511B (en) | 2014-06-30 | 2014-06-30 | Circuit and method for achieving non-polar 485 communication |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104090511A CN104090511A (en) | 2014-10-08 |
CN104090511B true CN104090511B (en) | 2017-01-18 |
Family
ID=51638233
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410307611.0A Active CN104090511B (en) | 2014-06-30 | 2014-06-30 | Circuit and method for achieving non-polar 485 communication |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104090511B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105719468A (en) * | 2014-12-04 | 2016-06-29 | 天津市品通电力科技有限公司 | Power dynamic simulation screen controller based on ethernet network |
CN105429907B (en) * | 2015-11-04 | 2018-06-19 | 上海斐讯数据通信技术有限公司 | Serial ports automatic identification equipment and method |
CN108988845B (en) * | 2017-05-31 | 2020-06-19 | 无锡华润矽科微电子有限公司 | Circuit for realizing polarity inversion by non-polarity RS485 |
CN109101362A (en) * | 2018-06-28 | 2018-12-28 | 广州视源电子科技股份有限公司 | Communicate bearing calibration, device, readable storage medium storing program for executing and slave |
CN113064849A (en) * | 2021-03-10 | 2021-07-02 | 深圳拓邦股份有限公司 | Communication method, device and communication circuit |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN200944597Y (en) * | 2006-09-19 | 2007-09-05 | 珠海格力电器股份有限公司 | Non-polarity communication interface module |
EP2079796A2 (en) * | 2006-11-01 | 2009-07-22 | Dow Global Technologies Inc. | Polyurethane compositions and articles prepared therefrom, and methods for making the same |
CN201557126U (en) * | 2009-12-08 | 2010-08-18 | 苏州新大诚科技发展股份有限公司 | Automatic reversing circuit with 485 communication interface |
CN101814983A (en) * | 2009-12-08 | 2010-08-25 | 苏州新大诚科技发展股份有限公司 | Automatic commutation circuit of 485 communication interface |
KR20100111946A (en) * | 2009-04-08 | 2010-10-18 | 주식회사 나라컨트롤 | The data-transmittable non-polarity rs-485 communication device of bms controller by automatic polarity discrimination |
CN102013600A (en) * | 2009-09-04 | 2011-04-13 | 刘爱民 | Singlechip for finishing nonpolar 485 communication function |
CN202794935U (en) * | 2012-09-25 | 2013-03-13 | 河南许继智能控制技术有限公司 | Automatic reversing circuit of 485 bus |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI366677B (en) * | 2007-12-28 | 2012-06-21 | Ind Tech Res Inst | Electrowetting display devices and fabrication methods thereof |
-
2014
- 2014-06-30 CN CN201410307611.0A patent/CN104090511B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN200944597Y (en) * | 2006-09-19 | 2007-09-05 | 珠海格力电器股份有限公司 | Non-polarity communication interface module |
EP2079796A2 (en) * | 2006-11-01 | 2009-07-22 | Dow Global Technologies Inc. | Polyurethane compositions and articles prepared therefrom, and methods for making the same |
US8124234B2 (en) * | 2006-11-01 | 2012-02-28 | Dow Global Technologies Llc | Polyurethane compositions and articles prepared therefrom, and methods for making the same |
KR20100111946A (en) * | 2009-04-08 | 2010-10-18 | 주식회사 나라컨트롤 | The data-transmittable non-polarity rs-485 communication device of bms controller by automatic polarity discrimination |
CN102013600A (en) * | 2009-09-04 | 2011-04-13 | 刘爱民 | Singlechip for finishing nonpolar 485 communication function |
CN201557126U (en) * | 2009-12-08 | 2010-08-18 | 苏州新大诚科技发展股份有限公司 | Automatic reversing circuit with 485 communication interface |
CN101814983A (en) * | 2009-12-08 | 2010-08-25 | 苏州新大诚科技发展股份有限公司 | Automatic commutation circuit of 485 communication interface |
CN202794935U (en) * | 2012-09-25 | 2013-03-13 | 河南许继智能控制技术有限公司 | Automatic reversing circuit of 485 bus |
Also Published As
Publication number | Publication date |
---|---|
CN104090511A (en) | 2014-10-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104090511B (en) | Circuit and method for achieving non-polar 485 communication | |
CN103106168B (en) | Automatic serial port protection circuit | |
CN102193048B (en) | Intelligent lead aligner | |
CN104199795B (en) | Data transferring and receiving method of bus framework | |
US20180285309A1 (en) | Data bus message filter | |
CN102752145B (en) | Novel detecting and isolating system for fault of RS-485 port and method thereof | |
CN104184638B (en) | The bus anti-collision methods of RS 485, interface chip and its communication network | |
CN101345584A (en) | Automatic detection method for optical fiber connection status of optical fiber communication equipments | |
CN105141480A (en) | Power over ethernet (PoE) switch test device, system and method | |
CN102882508A (en) | Simple circuit for switching polarity of RS485 interface | |
CN106095708A (en) | The electric current loop means of communication of two-wire system half-duplex one master and multiple slaves multi computer communication and system | |
CN102759693A (en) | Insulation detection circuit, inverter and insulation detection method thereof | |
CN103856411A (en) | Switching system connected with UART interface of router | |
CN104793544A (en) | Two-way power supply system for POE (power over Ethernet) | |
CN102394734A (en) | RS 485 communication system with nonpolarized connection and control method thereof | |
CN103916105A (en) | Apparatus for converting terminal polarity for rs communication | |
CN104182315B (en) | A kind of circuit, electronic equipment and its corresponding commissioning device of control debugging function | |
CN106227691B (en) | A kind of reciprocity bi-directional single-wire serial communication method based between MCU | |
CN102236630A (en) | Multi-equipment connecting system | |
CN205160517U (en) | Communication monitoring system | |
CN104199799A (en) | Baud rate self-adaptation method and device based on CPLD | |
CN104883286B (en) | A kind of BLVDS bus data transmission devices based on FPGA | |
CN203661079U (en) | 485 signal line reverse connection automatic recognition correction circuit | |
CN103838693B (en) | The device and mobile terminal of data transfer | |
CN203054078U (en) | Nonpolar 485 communication circuit suitable for electric energy meter |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |