CN210578569U - Novel optical coupler communication and automatic coding circuit - Google Patents

Novel optical coupler communication and automatic coding circuit Download PDF

Info

Publication number
CN210578569U
CN210578569U CN201920940881.3U CN201920940881U CN210578569U CN 210578569 U CN210578569 U CN 210578569U CN 201920940881 U CN201920940881 U CN 201920940881U CN 210578569 U CN210578569 U CN 210578569U
Authority
CN
China
Prior art keywords
pin
module
main control
control module
optical coupler
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
Application number
CN201920940881.3U
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.)
Wuhan Yuanchang Technology Co Ltd
Original Assignee
Wuhan Yuanchang 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 Wuhan Yuanchang Technology Co Ltd filed Critical Wuhan Yuanchang Technology Co Ltd
Priority to CN201920940881.3U priority Critical patent/CN210578569U/en
Application granted granted Critical
Publication of CN210578569U publication Critical patent/CN210578569U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Optical Communication System (AREA)

Abstract

The utility model provides a novel optical coupler communication and automatic coding circuit, including main control module, n monomer module, main control module singlechip and n monomer module singlechip, main control module and each monomer module Mx pass through optical coupler communication connection, and main control module's TX and RX pin are connected with main control module singlechip U1's TX and RX pin respectively, and main control module's SET pin is connected on other IO pins of main control module singlechip U1; the TXD pin and the RXD pin of each single module Mx are respectively connected to the TX pin and the RX pin of the corresponding single module single chip microcomputer Ux1, and the SET _ RX pin and the SET _ TX pin of each single module Mx are connected to other IO pins of the corresponding single module single chip microcomputer Ux 1. The circuit provided by the utility model can completely use the optocoupler to carry out isolated communication, thereby reducing the communication cost; the circuit realizes communication and automatic coding functions with a minimum of communication lines.

Description

Novel optical coupler communication and automatic coding circuit
Technical Field
The utility model relates to a communication circuit technical field, more specifically relates to a novel opto-coupler communication and automatic coding circuit.
Background
In the field of communication transmission, a communication mode of RS485+ optocouplers is generally adopted in a traditional communication mode, in the traditional communication mode, at least 5 communication cables are needed, twisted-pair wires are needed in an RS485 bus, the requirement on the cables is high, the cost of the twisted-pair wires is also high, and the cost of RS485 communication circuit devices is also high.
SUMMERY OF THE UTILITY MODEL
The utility model provides a overcome above-mentioned problem or solve above-mentioned problem's novel opto-coupler communication and automatic coding circuit at least partially.
The utility model provides a novel optical coupler communication and automatic coding circuit, which comprises a main control module, n monomer modules Mx, a main control module singlechip U1 and n monomer module singlechips Ux1 corresponding to the n monomer modules one by one;
the main control module and each monomer module Mx are in communication connection through an optical coupler, a TX pin of the main control module is connected with a TX pin of a main control module singlechip U1, an RX pin of the main control module is connected with an RX pin of a main control module singlechip U1, and an SET pin of the main control module is connected with an IO pin of the main control module singlechip U1; the TXD pin of each single module Mx is connected to the TX pin of the corresponding single module single chip microcomputer Ux1, the RXD pin of each single module Mx is connected to the RX pin of the corresponding single module single chip microcomputer Ux1, the SET _ RX and SET _ TX pins of each single module Mx are connected to the IO pin of the corresponding single module single chip microcomputer Ux1, where n is a positive integer, and x is 1,2, …, n.
The utility model has the advantages that: the optical coupler can be completely used for isolated communication, so that the communication cost is reduced; the circuit realizes communication and automatic coding functions with a minimum of communication lines.
On the basis of the technical scheme, the utility model discloses can also make following improvement.
Further, the main control module comprises a resistor R1, a resistor R2, a resistor R3, a resistor R4, an optical coupler OC1, an optical coupler OC2 and an optical coupler OC 3;
a pin 2 of the optical coupler OC1 is connected with VCC through the resistor R1, a pin 3 of the optical coupler OC1 is a TX pin of the main control module, the pin 3 is connected with a TX pin of the main control module singlechip U1, a pin 5 of the optical coupler OC1 is grounded, a pin 6 and a pin 7 are both connected with each single module, and a pin 8 is connected with VCCT;
pin 1 of the optical coupler OC2 is connected with VCCT, pin 2 is connected with each monomer module, pin 3 is grounded, pin 4 is RX pin of the main control module, and pin 4 is connected with RX pin of the main control module singlechip U1;
pin 1 of opto-coupler OC3 passes through resistance R3 connects the VCC, and pin 2 is the main control module's SET pin, this pin 2 with main control module singlechip U1's PB14 pin is connected, and first monomer module M1 is connected to pin 3, and pin 4 passes through resistance R4 connects VCCT.
Further, each single module Mx comprises a resistor Rx1, a resistor Rx2, a resistor Rx3, a resistor Rx4, a resistor Rx5, a resistor Rx6, a resistor Rx7, an optical coupler Ocx1, an optical coupler Ocx2, an optical coupler Ocx3 and an optical coupler Ocx 4;
pin 1 of the optical coupler Ocx1 is connected with pin 7 of an optical coupler OC1 in the main control module through the resistor Rx1, pin 2 and pin 3 of the optical coupler Ocx1 are grounded, pin 4 is an RXD pin of the monolithic module Mx, the pin 4 is connected with VCCM through the resistor Rx2, and the pin 4 is also connected with pin Rx of the monolithic module single chip microcomputer Ux 1;
a pin 1 of the optical coupler Ocx2 is connected with a VCCM (voltage regulator control module) through the resistor Rx4, a pin 2 is a TXD pin of the monomer module Mx, the pin 2 is connected with a TX pin of the monomer module singlechip Ux1, a pin 3 is grounded, and a pin 4 is connected with a pin 2 of an optical coupler OC2 in the main control module through the resistor Rx 3;
pin 1 of the optocoupler OCx3 is connected with pin 3 of an optocoupler OC3 in the main control module through the resistor Rx5, pin 2 and pin 3 of the optocoupler Ocx3 are grounded, pin 4 is a SET _ RX pin of the single module Mx, and pin 4 is connected with pin 17 of the single module singlechip Ux 1;
pin 1 of the optocoupler OCx4 is connected with VCCM through the resistor Rx7, pin 2 is a SET _ TX pin of the monolithic module Mx, pin 2 is connected with pin 16 of the monolithic module Ux1, pin 3 is connected with the next monolithic module Mx +1 of the monolithic module Mx, and pin 4 is connected with pin 2 of the optocoupler OC2 in the main control module.
Further, the model of the main control module single chip microcomputer U1 is ATSAMD21J18A, and the model of each single module single chip microcomputer Ux1 is ATSAMD09D 14A.
Furthermore, the type of the optical coupler OC1 is HCPL-3120, and the types of the optical coupler OC2 and the optical coupler OC3 are EL 357N-G.
Furthermore, the models of the optical coupler Ocx1, the optical coupler Ocx2, the optical coupler Ocx3 and the optical coupler Ocx4 are all EL 357N-G.
Drawings
Fig. 1 is a block diagram of a novel optocoupler communication and automatic coding circuit according to an embodiment of the present invention;
fig. 2 is a detailed circuit diagram of each module in fig. 1.
Detailed Description
The following detailed description of the embodiments of the present invention is provided with reference to the accompanying drawings and examples. The following examples are intended to illustrate the invention, but are not intended to limit the scope of the invention.
Referring to fig. 1, the utility model provides a novel opto-coupler communication and automatic coding circuit of an embodiment, including host system, a plurality of monomer module Mx of n, host system singlechip U1 and with a plurality of monomer module singlechip Ux1 of a plurality of monomer module one-to-one of n, wherein, n is positive integer, x ═ 1,2, …, n.
The main control module and each single module Mx are in optical coupling communication connection, a TX pin of the main control module is connected with a TX pin of a main control module single chip microcomputer U1, an RX pin of the main control module is connected with an RX pin of a main control module single chip microcomputer U1, and an SET pin of the main control module is connected to other IO pins of the main control module single chip microcomputer U1.
The TXD pin of each single module Mx is connected to the TX pin of the corresponding single module single chip microcomputer Ux1, the RXD pin of each single module Mx is connected to the RX pin of the corresponding single module single chip microcomputer Ux1, and the SET _ RX and SET _ TX pins of each single module Mx are connected to other IO pins of the corresponding single module single chip microcomputer Ux 1.
Referring to fig. 2, a specific circuit diagram of each module in fig. 1, in an embodiment of the present invention, the main control module includes a resistor R1, a resistor R2, a resistor R3, a resistor R4, an optical coupler OC1, an optical coupler OC2, and an optical coupler OC 3.
Pin 2 of opto-coupler OC1 connects the VCC through resistance R1, and pin 3 of opto-coupler OC1 is the TX pin of host system, and this pin 3 connects the TX pin of host system singlechip U1, and pin 5 ground connection of opto-coupler OC1, pin 6 and pin 7 all connect each monomer module, and pin 8 connects VCCT.
Pin 1 of the optical coupler OC2 is connected with VCCT, pin 2 is connected with each single module, pin 3 is grounded, pin 4 is RX pin of the main control module, and pin 4 is connected with RX pin of the main control module singlechip U1.
Pin 1 of opto-coupler OC3 connects the VCC through resistance R3, and pin 2 is the SET pin of master control module, and this pin 2 is connected with PB14 pin of master control module singlechip U1, and first monomer module M1 is connected to pin 3, and pin 4 connects VCCT through resistance R4.
In an embodiment of the present invention, each cell module Mx includes a resistor Rx1, a resistor Rx2, a resistor Rx3, a resistor Rx4, a resistor Rx5, a resistor Rx6, a resistor Rx7, an optical coupler Ocx1, an optical coupler Ocx2, an optical coupler Ocx3, and an optical coupler Ocx 4.
A pin 1 of the optical coupler Ocx1 is connected with a pin 7 of an optical coupler OC1 in the main control module through a resistor Rx1, a pin 2 and a pin 3 of the optical coupler Ocx1 are grounded, a pin 4 is an RXD pin of the single module Mx, the pin 4 is connected with a VCCM through a resistor Rx2, and the pin 4 is also connected with a pin RX of the single module singlechip Ux 1;
pin 1 of the optical coupler Ocx2 is connected with VCCM through a resistor Rx4, pin 2 is a TXD pin of the single module Mx, pin 2 is connected with a TX pin of the single module single chip microcomputer Ux1, pin 3 is grounded, and pin 4 is connected with pin 2 of an optical coupler OC2 in the main control module through a resistor Rx 3.
Pin 1 of the optical coupler OCx3 is connected with pin 3 of an optical coupler OC3 in the main control module through a resistor Rx5, pin 2 and pin 3 of the optical coupler Ocx3 are grounded, pin 4 is a SET _ Rx pin of the single module Mx, and pin 4 is connected with pin 17 of the single module single chip microcomputer Ux 1.
Pin 1 of optical coupler OCx4 connects VCCM through resistance Rx7, pin 2 is the SET _ TX pin of monomer module Mx, this pin 2 is connected with pin 16 of monomer module single-chip microcomputer Ux1, pin 3 is connected with the next monomer module Mx +1 of current monomer module Mx, for example, pin 3 of optical coupler OC14 in first monomer module M1 is connected with pin 1 of optical coupler OC23 through resistance R25 of second monomer module M2, pin 4 is connected with pin 2 of optical coupler OC2 in the main control module.
In the above embodiments of the present invention, the model of the main control module single chip microcomputer U1 is ATSAMD21J18A, and the model of each single module single chip microcomputer Ux1 is ATSAMD09D 14A. The optical couplers in the whole circuit are divided into two types, the optical coupler OC1 is one type, the rest optical couplers are the other types, the type of the optical coupler OC1 is HCPL-3120, the types of the rest optical couplers are EL357N-G, namely the types of the optical coupler OC2, the optical coupler OC3, the optical coupler Ocx1, the optical coupler Ocx2, the optical coupler Ocx3 and the optical coupler Ocx4 are EL 357N-G.
The utility model discloses an opto-coupler communication does with automatic coding circuit's communication principle, and when host system's serial ports TX began to send data, same data all can be received to all monomer modules on the bus, and according to MODBUS data protocol, monomer module will respond automatically. When the master control module needs to perform point-to-point communication on the single modules, for example, the master control module performs point-to-point communication to the single module M1, the master control module broadcasts the data packet of the single module M1 to all the single modules, and when the single module M1 receives a data check, the response data packet TXD pin is sent to the master control module, the RX pin of the master control module receives the response data packet of the single module M1, and other single modules keep a communication silent state, so that error codes caused by communication collision of a data bus are avoided.
The utility model provides an opto-coupler communication and automatic coding circuit still have automatic order coding function, and the concrete realization process does, before automatic coding, host system sends zero clearing RS485 communication address instruction, and the communication address of all monomer modules on the zero clearing bus becomes No. 1 communication address to monomer module M1 serial number. Firstly, the main control module controls the SET pin to be pulled down, so that the SET _ RX pin of the single module M1 immediately becomes a low potential state, and the SET _ RX pins of other single modules are all in a high potential state. Then the main control module sends a coding instruction packet to the bus through a TX pin, and all the single modules on the bus receive the coding instruction packet. When each single module receives the coding instruction packet, the potential state of its SET _ RX pin is detected, and when the single module M1 receives the coding instruction packet, it detects that its SET _ RX pin is in a low potential state, so that the single module M1 responds to the coding instruction and SETs its 485 communication address to 1. At this time, the single module M1 sends a coding success response packet to the main control module. After the main control module receives the successful code response packet of the single module M1, the potential of the SET pin is pulled up, and the code enabling state of the single module M1 is closed. The monomer module M2 is then numbered as communication address No. 2: the main control module sends a data packet command for pulling down the coding pin to the single module M1, the single module M1 receives the data packet command and then responds to the main control module, then immediately pulls down the potential of the SET _ TX pin of the single module M1, and after a period of time, such as 100ms, pulls up the potential of the SET _ TX pin to release the receiving bus of the main control module. When the SET _ TX pin of the cell module M1 is pulled low, the SET _ RX pin of the cell module M2 is also pulled low. At this time, the main control module broadcasts and sends the coding instruction packet of the single module M2 on the data bus, and at this time, only the coding enable pin SET _ RX of the single module M2 on the bus is in a low potential state, so the single module M2 responds to the coding instruction data packet coded by number 2, SETs its RS485 communication address to 2, and after waiting for 100ms in a delayed manner, the receiving bus of the main control module is released, and then sends its coding success response packet to the main control module. After receiving the successful coding response packet of the single module M2, the main control module sends a command packet for pulling down the coding pins to the single module M2, so as to enable the coding pins of the single module M3, and so on, until the coding of all the single modules on the bus is completed, thereby realizing the automatic coding function of all the single modules on the bus.
The utility model provides a novel optical coupler and automatic coding circuit, all adopt optical coupler communication connection between main control module and each monomer module, can use the optical coupler device completely to carry out isolated communication, the optical coupler device compares the cost of traditional RS485 communication device low, has reduced whole communication cost; in the circuit, the main control module can establish communication connection with each monomer module only by three communication lines, and in addition, the main control module and each monomer module are grounded by the ground wires, so that the circuit can be realized by only 4 lines in total, compared with the traditional communication mode, at least 5 communication cables are needed, and the communication and automatic coding functions are realized by the fewest communication lines; the circuit uses the optical coupler for communication, and the bus only needs to use a common telephone line, compared with the conventional communication mode, the bus needs to use a twisted pair, and the requirement on a communication cable is lower.
Finally, the method of the present application is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A novel optical coupling communication and automatic coding circuit is characterized by comprising a main control module, n monomer modules Mx, a main control module single chip microcomputer U1 and n monomer module single chip microcomputers Ux1 corresponding to the n monomer modules one by one, wherein n is a positive integer, and x is 1,2, … and n;
the main control module and each monomer module Mx are in communication connection through an optical coupler, a TX pin of the main control module is connected with a TX pin of a main control module singlechip U1, an RX pin of the main control module is connected with an RX pin of a main control module singlechip U1, and an SET pin of the main control module is connected with an IO pin of the main control module singlechip U1; the TXD pin of each single module Mx is connected to the TX pin of the corresponding single module single chip microcomputer Ux1, the RXD pin of each single module Mx is connected to the RX pin of the corresponding single module single chip microcomputer Ux1, and the SET _ RX and SET _ TX pins of each single module Mx are connected to the IO pin of the corresponding single module single chip microcomputer Ux 1.
2. The novel optical coupler communication and automatic coding circuit as claimed in claim 1, wherein the main control module comprises a resistor R1, a resistor R2, a resistor R3, a resistor R4, an optical coupler OC1, an optical coupler OC2 and an optical coupler OC 3;
a pin 2 of the optical coupler OC1 is connected with VCC through the resistor R1, a pin 3 of the optical coupler OC1 is a TX pin of the main control module, the pin 3 is connected with a TX pin of the main control module singlechip U1, a pin 5 of the optical coupler OC1 is grounded, a pin 6 and a pin 7 are both connected with each single module, and a pin 8 is connected with VCCT;
pin 1 of the optical coupler OC2 is connected with VCCT, pin 2 is connected with each monomer module, pin 3 is grounded, pin 4 is RX pin of the main control module, and pin 4 is connected with RX pin of the main control module singlechip U1;
pin 1 of opto-coupler OC3 passes through resistance R3 connects the VCC, and pin 2 is the main control module's SET pin, this pin 2 with main control module singlechip U1's PB14 pin is connected, and first monomer module M1 is connected to pin 3, and pin 4 passes through resistance R4 connects VCCT.
3. The novel optocoupler communication and automatic coding circuit according to claim 2, wherein each of the cell modules Mx comprises a resistor Rx1, a resistor Rx2, a resistor Rx3, a resistor Rx4, a resistor Rx5, a resistor Rx6, a resistor Rx7, an optocoupler Ocx1, an optocoupler Ocx2, an optocoupler Ocx3, an optocoupler Ocx 4;
pin 1 of the optical coupler Ocx1 is connected with pin 7 of an optical coupler OC1 in the main control module through the resistor Rx1, pin 2 and pin 3 of the optical coupler Ocx1 are grounded, pin 4 is an RXD pin of the monolithic module Mx, the pin 4 is connected with VCCM through the resistor Rx2, and the pin 4 is also connected with pin Rx of the monolithic module single chip microcomputer Ux 1;
a pin 1 of the optical coupler Ocx2 is connected with a VCCM (voltage regulator control module) through the resistor Rx4, a pin 2 is a TXD pin of the monomer module Mx, the pin 2 is connected with a TX pin of the monomer module singlechip Ux1, a pin 3 is grounded, and a pin 4 is connected with a pin 2 of an optical coupler OC2 in the main control module through the resistor Rx 3;
pin 1 of the optocoupler OCx3 is connected with pin 3 of an optocoupler OC3 in the main control module through the resistor Rx5, pin 2 and pin 3 of the optocoupler Ocx3 are grounded, pin 4 is a SET _ RX pin of the single module Mx, and pin 4 is connected with pin 17 of the single module singlechip Ux 1;
pin 1 of the optocoupler OCx4 is connected with VCCM through the resistor Rx7, pin 2 is a SET _ TX pin of the monolithic module Mx, pin 2 is connected with pin 16 of the monolithic module Ux1, pin 3 is connected with the next monolithic module Mx +1 of the monolithic module Mx, and pin 4 is connected with pin 2 of the optocoupler OC2 in the main control module.
4. The novel optical coupler communication and automatic coding circuit as claimed in claim 1, wherein the model of the master control module single chip microcomputer U1 is ATSAMD21J18A, and the model of each single module single chip microcomputer Ux1 is ATSAMD09D 14A.
5. The novel optocoupler communication and automatic coding circuit according to claim 2, wherein the optocoupler OC1 is of the model number HCPL-3120, and the optocoupler OC2 and the optocoupler OC3 are of the model number EL 357N-G.
6. The novel optocoupler communication and automatic coding circuit according to claim 3, wherein the optocoupler Ocx1, optocoupler Ocx2, optocoupler Ocx3 and optocoupler Ocx4 are all models EL 357N-G.
CN201920940881.3U 2019-06-20 2019-06-20 Novel optical coupler communication and automatic coding circuit Active CN210578569U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201920940881.3U CN210578569U (en) 2019-06-20 2019-06-20 Novel optical coupler communication and automatic coding circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201920940881.3U CN210578569U (en) 2019-06-20 2019-06-20 Novel optical coupler communication and automatic coding circuit

Publications (1)

Publication Number Publication Date
CN210578569U true CN210578569U (en) 2020-05-19

Family

ID=70633627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201920940881.3U Active CN210578569U (en) 2019-06-20 2019-06-20 Novel optical coupler communication and automatic coding circuit

Country Status (1)

Country Link
CN (1) CN210578569U (en)

Similar Documents

Publication Publication Date Title
CN108647180A (en) A kind of arithmetic system and corresponding electronic equipment
CN201335955Y (en) CAN bus intelligent electric device based on CANopen protocol
CN208477523U (en) A kind of arithmetic system and corresponding electronic equipment
CN106649171A (en) Single-bus full-duplex data communication method and system
CN114301732B (en) Circuit for realizing bus communication, bus communication system and power supply energy storage device
CN102098196B (en) The data transmission method of blade server
US6609172B1 (en) Breaking up a bus to determine the connection topology and dynamic addressing
CN210578569U (en) Novel optical coupler communication and automatic coding circuit
CN210867765U (en) Remote control network switch
CN108337095A (en) G.fast SFP modules
CN115663549B (en) Multi-interface conversion device and vehicle
CN201820120U (en) Self-adapting multibus execution mechanism controller
CN209118135U (en) A kind of automobile-used CAN bus telecommunication circuit of electrical salf-walking
CN209842613U (en) Data transmission device
CN209447019U (en) RS485 equipment connects circuit and system
CN212811729U (en) On-board communication circuit and device based on CAN communication
CN210721160U (en) Temperature control circuit and temperature control device
CN213367785U (en) On-board communication circuit and device based on CAN communication
CN102868583A (en) FlexRay bus joint with fault diagnosis function
CN210377444U (en) USB isolator and isolation system for eliminating signal interference and power interference
CN110297795B (en) System and method for realizing single-channel serial data transmission based on Ethernet PHY chip
CN111711552A (en) Terminal resistor access circuit, servo driver and control system
CN107770017A (en) The processing unit and method that a kind of CAN reversal connection can not communicate
CN215067812U (en) CAN network based on CAN controller and gate circuit are constituteed
CN101662405A (en) Communication circuit of CAN bus

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant