CN103338031B - The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications - Google Patents
The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications Download PDFInfo
- Publication number
- CN103338031B CN103338031B CN201310257424.1A CN201310257424A CN103338031B CN 103338031 B CN103338031 B CN 103338031B CN 201310257424 A CN201310257424 A CN 201310257424A CN 103338031 B CN103338031 B CN 103338031B
- Authority
- CN
- China
- Prior art keywords
- port
- circuit
- signal
- counter
- optocoupler
- 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
Landscapes
- Programmable Controllers (AREA)
- Electronic Switches (AREA)
Abstract
The invention discloses the special driving method of a kind of RS485 circuit in two optocoupler peripheral applications, step is: when the signal of RE/DE port is for " 1 ", RS485 circuit enters normal drive mode; When the signal of RE/DE port becomes " 0 " from " 1 ", circuit enters special drive pattern, now, circuit produces the drive singal of " 1 " or " 0 ", if RE/DE port keeps " 0 " signal, counter keeping count always, until meter is full, this circuit exits special drive pattern and gets back to normal mode of operation, continues to realize normal communication function; If the signal recuperation of RE/DE port is to " 1 ", then this circuit returns to driven device pattern at once, continues to realize driven.The present invention can realize the driving force of three optocouplers, again the peripheral applications mode of compatible two optocouplers, adapts to new national grid standard, saves optocoupler and upper pull down resistor, decreases cost.
Description
Technical field
The present invention relates to a kind of driving method of circuit, specifically the special driving method of a kind of RS485 circuit in two optocoupler peripheral applications.
Background technology
At present, RS485 circuit is widely used in meter circuit and other association areas.Existing RS485 circuit generally has two kinds of peripheral applications modes: one as shown in Figure 1, adopt the peripheral applications mode of two optocouplers: RE, DE port of RS485 circuit links together and is connected two optocouplers respectively with RO port, DI port ground connection, provide control signal by MCU, A, B port adds pull down resistor.Under the application mode of this two optocouplers, RS485 drives " 0 " signal is provided by the driving of its circuit self, and when needs RS485 circuit provides " 1 " signal, pulled power supply and resistance over the ground by A, B port, driving force is poor.According to demand, also may be provided by the driving of its circuit self by RS485 drives " 1 " signal, when needs RS485 circuit provides " 0 " signal, by A, B port, power supply and resistance are over the ground pulled.
Another kind as shown in Figure 2, adopts the peripheral applications mode of three optocouplers: RE, DE port of RS485 circuit links together and is connected three optocouplers respectively with RO port, DI port, provides control signal by MCU.Under the application model of this three optocouplers, when needs RS485 interface circuit provides " 0 " and " 1 " signal, all export " 1 " and " 0 " signal by DI port controlling A, B port, driving force is stronger, but need many consumption MCU control port, and a multiplex optocoupler is connected with DI port, and cost is high.
According to the requirement that in January, 2013, national grid new standard was put into effect, A, B port of each ammeter will realize the function of automatic decision polarity, cannot add pull down resistor to strengthen driving force.In order to the requirement of driving force, each ammeter factory can only adopt the scheme of three optocouplers, adds cost.
Summary of the invention
The object of this invention is to provide the special driving method of a kind of RS485 circuit in two optocoupler peripheral applications, the method can realize the driving force of three optocouplers, again can the peripheral applications mode of compatible two optocouplers.
In order to solve the problems of the technologies described above adopted technical scheme be, the special driving method of a kind of RS485 circuit in two optocoupler peripheral applications, wherein RS485 circuit has input, output module, also there is many of RO, RE, DE, DI, A, B control and PORT COM, it is characterized in that, described special driving method specifically comprises the steps:
1) when the signal of RE/DE port is " 1 ", RS485 circuit enters normal drive mode, and under normal driving mode of operation, RS485 circuit realiration drives function normally;
2) when the signal of RE/DE port becomes " 0 " from " 1 ", make RS485 circuit enter special drive pattern, and start counting by the counter arranged in RS485 circuit;
3) under special drive pattern, the A port of RS485 circuit exports the drive singal anti-phase with DI port, B port exports the drive singal with DI port homophase, can certainly change to B port as required and export the drive singal anti-phase with DI port, A port exports the drive singal with DI port homophase;
4) under special drive pattern, if RE/DE port keeps " 0 " signal always, counter keeping count, until counter counts is full, now RS485 circuit exits special drive pattern and gets back to driven device pattern, continues to realize driving function normally;
5) under special drive pattern, if the signal recuperation of RE/DE port is to " 1 ", then RS485 circuit returns to driven device pattern at once, continues to realize driving function normally.
Preferred: described counter counts full time and RS485 circuit keep the time of special drive pattern, can be set to for 10 μ seconds.
The present invention provides a kind of RS485 circuit that can realize above-mentioned special driving method simultaneously, there is control module, counter and oscillator, the input of RE, DE port link control module, the output control connection counter of control module, output module, input module; The input of input module connects A, B port, and its output connects RO port; The input of output module connects DI port, and its output connects A, B port; The input connection oscillator of counter, its output link control module.
The invention has the beneficial effects as follows: by method of the present invention, under the peripheral applications mode of employing two optocoupler, when the signal of RE/DE port becomes " 0 " from " 1 ", RS485 circuit is needed again to provide " 1 " or " 0 " signal, A, B port is not needed to pull power supply and upper pull down resistor over the ground, RS485 circuit enters special drive pattern automatically, can realize RS485 circuit and export " 1 " or " 0 " signal under special drive pattern.By arranging judgement counting module in circuit, making RS485 circuit exit special drive pattern, continuing to enter normal communication mode.Present invention achieves the driving force under three optocoupler peripheral applications modes, decrease an optocoupler and two upper pull down resistors, reduce cost, adapt to new national grid standard.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of existing RS485 circuit two optocoupler peripheral applications mode;
Fig. 2 is the structured flowchart of existing RS485 circuit three optocoupler peripheral applications mode;
Fig. 3 is the structured flowchart of RS485 circuit two optocoupler peripheral applications mode of the present invention;
Fig. 4 is workflow diagram of the present invention;
Fig. 5, for realizing a kind of RS485 circuit structure block diagram of the present invention;
Fig. 6 is the work wave of existing RS485 circuit under two optocoupler application modes;
Fig. 7 is the work wave of RS485 circuit of the present invention under two optocoupler application modes.
Embodiment
Below in conjunction with accompanying drawing 3, Fig. 4, Fig. 5, Fig. 6, Fig. 7, a kind of concrete execution mode of the present invention is described.
As shown in Figure 3, for the structured flowchart of RS485 circuit two optocoupler peripheral applications mode of the present invention, compared with the existing RS485 circuit two optocoupler application mode shown in accompanying drawing 1, eliminate two upper pull down resistors of A, B port, compared with the existing RS485 circuit three optocoupler peripheral applications mode shown in accompanying drawing 2, eliminate the optocoupler be connected with DI port.
As shown in Figure 5, it is a kind of RS485 circuit that can realize the inventive method, this circuit comprises RE, DE, RO, DI, A, B many control ports that input module 1, output module 2, control module 3, counter 4 and oscillator 5 and RS485 chip have, the input of RE, DE port link control module 3, the output control connection counter 4 of control module 3, output module 2, input module 1; The input of input module 1 connects A, B port, and its output connects RO port; The input of output module 2 connects DI port, and its output connects A, B port; The input connection oscillator 5 of counter 4, its output link control module 3.The operation principle of this circuit is as follows: RE, DE port is connected to control module 3, control module 3 control counter 4, output module 2, input module 1; Input module 1 receives the signal of A, B port, and outputs to RO port; Output module 2 receives DI port signal, and outputs to A, B port; Counter 4 provides clock signal by oscillator 5, and count results is delivered to control module 3.
As shown in Figure 4, for workflow diagram of the present invention, composition graphs 5, a kind of embodiment of the present invention is as follows: the gate time that can adjust counter 4 according to specific needs, set the counter 4 full time as 10 μ s in the present embodiment, when the signal of RE/DE port is " 1 ", RS485 circuit enters normal drive mode, under normal driving mode of operation, RS485 circuit realiration drives function normally; When the signal of RE/DE port becomes " 0 " from " 1 ", the control module 3 be connected with RE/DE port makes RS485 circuit enter special drive pattern, and starts counting by the counter 4 arranged in RS485 circuit; Under special drive pattern, the A port of RS485 circuit exports the drive singal anti-phase with DI port, B port exports the drive singal with DI port homophase, can certainly change to B port as required and export the drive singal anti-phase with DI port, A port exports the drive singal with DI port homophase.Under special drive pattern, if RE/DE port keeps " 0 " signal always, counter 4 keeping count, until full 10 μ second (this time can adjust as required) of counter 4, now RS485 circuit exits special drive pattern and gets back to normal mode of operation, continues to realize normal communication function; Under special drive pattern, if the signal recuperation of RE/DE port is to " 1 ", then RS485 circuit returns to driven device pattern at once, continues to realize driving function normally.
As shown in Figure 6, be the work wave of existing RS485 circuit under two optocoupler peripheral applications modes.After the signal of RE/DE port becomes " 0 " from " 1 ", A port is charged to VCC(supply voltage by pull-up resistor), B port discharges into GND(ground voltage by pull down resistor).The process of this discharge and recharge is comparatively slow, once load is more, or on port, pull down resistor is comparatively large, charging and discharging currents is too small, or when signal transmission rate is too fast, then there will be A port signal and cannot charge to VCC voltage, B port signal cannot be discharged to GND voltage.The differential voltage of A, B port is once too small, and receiving terminal cannot judge, thus cannot communication.
As shown in Figure 7, be the work wave of the present invention under two optocoupler peripheral applications modes.The special driving method of application the present invention then there will not be the work wave shown in accompanying drawing 6, and driving force of the present invention is consistent with the driving function of existing three optocoupler schemes." 0 " and " 1 " signal provides driving by circuit, after RE/DE port has a falling pulse to arrive, circuit all can enter a special drive pattern, and keep certain hour, under this special drive pattern, circuit exports " 1 " signal (A port exports the drive singal anti-phase with DI port, and B port exports the drive singal with DI port homophase) or " 0 " signal (B port exports the drive singal anti-phase with DI port, and A port exports the drive singal with DI port homophase).Thus under the peripheral applications mode of two optocouplers, achieve the driving force of three optocouplers, simultaneous adaptation national grid new standard, save upper pull down resistor and the optocoupler of A, B port.
Claims (2)
1. the special driving method of RS485 circuit in two optocoupler peripheral applications, the wherein a kind of RS485 circuit realizing the method has input module (1), output module (2), also has control module (3), counter (4) and oscillator (5); The input of RE, DE port link control module (3), the output control connection counter (4) of control module (3), output module (2), input module (1); The input of input module (1) connects A, B port, and its output connects RO port; The input of output module (2) connects DI port, and its output connects A, B port; The input connection oscillator (5) of counter (4), its output link control module (3), is characterized in that: described special driving method specifically comprises the steps:
1) when the signal of RE/DE port is " 1 ", RS485 circuit enters normal drive mode, and under normal drive mode, RS485 circuit realiration drives function normally;
2) when the signal of RE/DE port becomes " 0 " from " 1 ", make RS485 circuit enter special drive pattern, and start counting by the counter arranged in RS485 circuit;
3) under special drive pattern, a port in the A port of RS485 circuit and B port exports the drive singal anti-phase with DI port, and another port exports the drive singal with DI port homophase;
4) under special drive pattern, if RE/DE port keeps " 0 " signal always, counter keeping count, until counter counts is full, now RS485 circuit exits special drive pattern and gets back to normal mode of operation, continues to realize normal communication function;
5) under special drive pattern, if the signal recuperation of RE/DE port is to " 1 ", then RS485 circuit returns to driven device pattern at once, continues to realize driving function normally.
2. the special driving method of a kind of RS485 circuit according to claim 1 in two optocoupler peripheral applications, is characterized in that: the full time of the counter counts in described step 4) and RS485 circuit keep the time of special drive pattern, is 10 μ seconds.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310257424.1A CN103338031B (en) | 2013-06-26 | 2013-06-26 | The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310257424.1A CN103338031B (en) | 2013-06-26 | 2013-06-26 | The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103338031A CN103338031A (en) | 2013-10-02 |
CN103338031B true CN103338031B (en) | 2015-10-14 |
Family
ID=49246145
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310257424.1A Active CN103338031B (en) | 2013-06-26 | 2013-06-26 | The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103338031B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110690888B (en) * | 2019-09-29 | 2022-10-14 | 北京中科格励微科技有限公司 | Isolator for digital signals |
CN112034324A (en) * | 2020-06-23 | 2020-12-04 | 贵州电网有限责任公司 | Method and device for detecting driving capability of RS485 circuit |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026387A (en) * | 2007-02-13 | 2007-08-29 | 徐震 | Automatic stream control device, control method and its circuit |
CN201788205U (en) * | 2010-08-18 | 2011-04-06 | 宁波三星电气股份有限公司 | 485 communication circuit of electricity meter |
CN201821098U (en) * | 2010-04-28 | 2011-05-04 | 武汉迈威光电技术有限公司 | RS-485 or Profibus signal polarity automatic identification and switching technology |
US8018245B2 (en) * | 2009-04-01 | 2011-09-13 | Samsung Electronics Co., Ltd. | Semiconductor device |
CN102938720A (en) * | 2012-11-21 | 2013-02-20 | 武汉昊昱微电子股份有限公司 | Non-polarity communication circuit based on ammeter application |
-
2013
- 2013-06-26 CN CN201310257424.1A patent/CN103338031B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026387A (en) * | 2007-02-13 | 2007-08-29 | 徐震 | Automatic stream control device, control method and its circuit |
US8018245B2 (en) * | 2009-04-01 | 2011-09-13 | Samsung Electronics Co., Ltd. | Semiconductor device |
CN201821098U (en) * | 2010-04-28 | 2011-05-04 | 武汉迈威光电技术有限公司 | RS-485 or Profibus signal polarity automatic identification and switching technology |
CN201788205U (en) * | 2010-08-18 | 2011-04-06 | 宁波三星电气股份有限公司 | 485 communication circuit of electricity meter |
CN102938720A (en) * | 2012-11-21 | 2013-02-20 | 武汉昊昱微电子股份有限公司 | Non-polarity communication circuit based on ammeter application |
Also Published As
Publication number | Publication date |
---|---|
CN103338031A (en) | 2013-10-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105720807B (en) | It is detained the method and device of voltage for detecting input voltage and releasing | |
CN102673421A (en) | Method for switching sleep mode and wakeup mode of electric vehicle control unit and realization circuit thereof | |
CN101549673B (en) | Method and circuit for waking-up weak hybrid power entire car controller in dormant mode | |
CN204929366U (en) | DALI interface circuit | |
CN108001265A (en) | A kind of battery management system equipped with serial communication detection | |
CN103338031B (en) | The special driving method of a kind of RS485 circuit in two optocoupler peripheral applications | |
CN110797946A (en) | Battery pack charging and discharging protection system | |
CN201623642U (en) | Intelligent low power consumption power supply adaptor | |
CN107221293A (en) | Duty ratio adjusting circuit and LED backlight brightness regulating circuit | |
CN201039123Y (en) | Seamless cascading multi-channel power on control circuit | |
CN203352252U (en) | Intelligent mobile power supply device | |
CN205901426U (en) | Can realize that commercial power and battery switch fire control intelligence switch power of power supply | |
CN205407360U (en) | Idle rechargeable battery automatic safety device | |
CN107659476B (en) | Communication device | |
CN201118266Y (en) | Pull-type accumulator charger charging controller | |
CN100485559C (en) | Communication transmit-receiver switch controller and its control method | |
CN107733402A (en) | Towards the sequential monitoring unit and monitoring system of nearly threshold value low-voltage | |
CN204103608U (en) | A kind of capacitor fast charging circuit | |
CN104022558B (en) | Uninterrupted formula lead-acid battery charge-discharge system | |
CN103237246A (en) | Set-top box actual standby and standby wake-up circuit and set-top box | |
CN203311413U (en) | RS485 interface circuit | |
CN106786894B (en) | One kind being based on binodal lithium battery fast charge method and electronic equipment charging module | |
CN101938157A (en) | Charging circuit and charging management circuit thereof | |
CN109888766A (en) | Bus takes electric equipment and its power consumption control methods, devices and systems, electrical equipment | |
CN214314665U (en) | Charging stop detection system |
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 | ||
CP03 | Change of name, title or address |
Address after: 214135 -6, Linghu Avenue, Wuxi Taihu international science and Technology Park, Wuxi, Jiangsu, China, 180 Patentee after: China Resources micro integrated circuit (Wuxi) Co., Ltd Address before: No.180-22, Linghu Avenue, Taihu International Science and Technology Park, Wuxi, Jiangsu 214100 Patentee before: WUXI CHINA RESOURCES SEMICO Co.,Ltd. |
|
CP03 | Change of name, title or address |