CN106850132B - Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system - Google Patents

Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system Download PDF

Info

Publication number
CN106850132B
CN106850132B CN201611191996.4A CN201611191996A CN106850132B CN 106850132 B CN106850132 B CN 106850132B CN 201611191996 A CN201611191996 A CN 201611191996A CN 106850132 B CN106850132 B CN 106850132B
Authority
CN
China
Prior art keywords
output
bit
resistor
zero
character information
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
CN201611191996.4A
Other languages
Chinese (zh)
Other versions
CN106850132A (en
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.)
Shenzhen Mcquay Air Conditioning Co Ltd
Original Assignee
Shenzhen Mcquay Air Conditioning 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 Shenzhen Mcquay Air Conditioning Co Ltd filed Critical Shenzhen Mcquay Air Conditioning Co Ltd
Priority to CN201611191996.4A priority Critical patent/CN106850132B/en
Publication of CN106850132A publication Critical patent/CN106850132A/en
Application granted granted Critical
Publication of CN106850132B publication Critical patent/CN106850132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0006Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Dc Digital Transmission (AREA)

Abstract

The application discloses a character frame sending/receiving method, a sending/receiving end and a one-way communication system, wherein the character frame sending method comprises the following steps: sequentially sending each bit of character information in the character frame bit by bit until the last bit is sent; the method for sending any bit of character information comprises the following steps: identifying the type of the local character information, wherein different types of character information correspond to different mi; counting the number S of zero-crossing points of the sinusoidal alternating current signal input into the modulation circuit, outputting a modulation signal according to the S value, ending and resetting S until S is 2mi +1+2ni, wherein mi and ni are positive integers; wherein outputting the modulation signal according to the S value includes: when S is more than or equal to 0 and less than 2mi +1, the modulation circuit is controlled to output the sinusoidal alternating current signal; and when the S is more than or equal to 2mi +1 and less than 2mi +1+2ni, the modulation circuit is controlled not to output. The long-distance stable communication under the one-way communication occasion is realized and the wiring is simplified.

Description

Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system
Technical Field
The present invention relates to the field of industrial control technologies, and more particularly, to a character frame transmitting/receiving method, a transmitting/receiving end, and a unidirectional communication system.
Background
Data communication methods can be classified into two major categories, a unidirectional communication method and a bidirectional communication method. At present, the data communication modes commonly used in the industrial environment include bidirectional communication modes such as an I2C bus, an SPI bus, an RS485 bus, a TTL asynchronous serial port communication mode and the like, and unidirectional communication modes such as remote controller infrared communication and the like.
The above communication modes can be suitable for occasions only needing one-way communication, but the infrared communication of the remote controller has limitation on the communication distance, and the long-distance stable communication can be realized by the I2C bus, the SPI bus, the RS485 bus, the TTL asynchronous serial port communication modes and the like, but the wiring is complex, the wiring error of the product is easy to occur, more bad return products are brought, and the product quality and the brand position of an enterprise are influenced.
Therefore, how to implement long-distance stable communication and simplify wiring in the case of unidirectional communication has become an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the present invention provides a character frame transmitting/receiving method, a transmitting/receiving end and a unidirectional communication system, so as to realize long-distance stable communication and simplify wiring in the unidirectional communication situation.
A character frame sending method is applied to a sending end, a modulation circuit in the sending end is provided with a sine alternating current signal input pin, and the method comprises the following steps:
acquiring a character frame to be sent, wherein the character frame comprises four types of character information, namely an initial bit, a data low level bit, a data high level bit, a stop bit and the like;
controlling the modulation circuit to sequentially send each bit of character information in the character frame bit by bit until the last bit of character information is sent;
the method for controlling the modulation circuit to transmit any bit character information in the character frame comprises the following steps: identifying the type of the local character information, wherein the different types of character information correspond to different mi values, and mi is a positive integer; counting the number S of zero-crossing points of the sinusoidal alternating current signal input into the modulation circuit, outputting a modulation signal according to the value S, ending and resetting S until S is 2mi +1+2ni, wherein ni is a positive integer;
wherein, the outputting a modulation signal according to the S value includes: when S is more than or equal to 0 and less than 2mi +1, outputting a first level signal, wherein the first level signal is used for controlling the modulation circuit to output the sinusoidal alternating current signal; and when S is more than or equal to 2mi +1 and less than 2mi +1+2ni, outputting a second level signal, wherein the second level signal is used for controlling the modulation circuit not to output.
Wherein mi is less than or equal to 4, and ni is 1.
A character frame receiving method is applied to a receiving end, and a demodulation circuit in the receiving end is used for receiving a character frame when an input voltage is equal to V0Time-reversal level, V0Not less than 0, the method comprises the following steps:
judging whether the demodulation circuit has pulse output;
if the demodulation circuit outputs pulses, counting the number mj and nj of short pulses and long pulses output by the demodulation circuit; when nj is ni, determining the type of the character information uniquely corresponding to the mj value; then, resetting mj and nj, and returning to the step of judging whether the demodulation circuit has pulse output;
if the demodulation circuit stops pulse output, the data content transmitted by the transmitting end in the form of character frames is determined according to the type of the character information determined one by one.
A sending end comprises a zero-crossing detection circuit, a modulation circuit and a first control unit, wherein the zero-crossing detection circuit is used for detecting a zero crossing of a signal;
the zero-crossing point detection circuit is provided with a sine alternating current signal input pin and is used for converting an input sine alternating current signal into pulse signals, and the number of the pulses is equal to the number of zero-crossing points of the sine alternating current signal; the output pin of the zero-crossing detection circuit is connected with the first control unit;
the first control unit is used for acquiring a character frame to be sent, wherein the character frame comprises four types of character information, namely a start bit, a data low level bit, a data high level bit, a stop bit and the like; controlling the modulation circuit to sequentially send each bit of character information in the character frame bit by bit until the last bit of character information is sent; the method for controlling the modulation circuit to transmit any bit character information in the character frame comprises the following steps: identifying the type of the local character information, wherein different types of character information correspond to different mi values, mi is a positive integer, counting the number S of zero crossing points of a sinusoidal alternating current signal input into the modulation circuit, outputting a modulation signal according to the S value, ending and resetting S until S is 2mi +1+2ni, wherein ni is a positive integer; wherein, the outputting a modulation signal according to the S value includes: when S is more than or equal to 0 and less than 2mi +1, a first level signal is output, and when S is more than or equal to 2mi +1 and less than 2mi +1+2ni, a second level signal is output;
the modulation circuit is provided with a sine alternating current signal input pin and a control signal input pin, wherein the control signal input pin is used for receiving the first level signal and the second level signal, the first level signal is used for controlling the modulation circuit to output the sine alternating current signal, and the second level signal is used for controlling the modulation circuit not to output.
Wherein mi is less than or equal to 4, and ni is 1.
The zero-crossing detection circuit comprises a first resistor, a photoelectric isolation bidirectional thyristor and a second resistor, and specifically comprises:
one end of the first resistor is used as a live wire connecting terminal, and the other end of the first resistor is connected with a first input terminal of the photoelectric isolation bidirectional thyristor;
a second input terminal of the photoelectric isolation bidirectional thyristor is used as a zero line wiring terminal;
a collector electrode at the output side of the photoelectric isolation bidirectional thyristor is connected with a direct current source through the second resistor, and the collector electrode is used as an output pin of the zero-crossing detection circuit; the emitting electrode at the output side of the photoelectric isolation bidirectional thyristor is grounded;
the live wire connecting terminal and the zero line connecting terminal are sine alternating current signal input pins of the zero-crossing detection circuit.
Wherein, modulation circuit includes first resistance, second resistance, optoelectronic isolation bidirectional thyristor and bidirectional thyristor, and is specific:
the anode of the input side of the photoelectric isolation bidirectional thyristor is connected with a direct current source through the first resistor;
the cathode of the input side of the photoelectric isolation bidirectional thyristor is used as a control signal input pin of the modulation circuit;
one end of the second resistor is used as a live wire connecting terminal, and the other end of the second resistor is connected with a first output terminal on the output side of the photoelectric isolation bidirectional thyristor;
the input electrode of the bidirectional controllable silicon is connected with a first output terminal at the output side of the photoelectric isolation bidirectional thyristor, the control electrode of the bidirectional controllable silicon is connected with a second output terminal at the output side of the photoelectric isolation bidirectional thyristor, and the output electrode of the bidirectional controllable silicon is used as an output pin of the modulation circuit.
A receiving end comprising a second control unit and a demodulation circuit, wherein:
the demodulation circuit is used for receiving the input voltage equal to V0Time-reversal level, V0≥0;
The output pin of the demodulation circuit is connected with the second control unit;
the second control unit is used for judging whether the demodulation circuit has pulse output; if the demodulation circuit outputs pulses, counting the number mj and nj of short pulses and long pulses output by the demodulation circuit; when nj is ni, determining the type of the character information uniquely corresponding to the mj value; then, resetting mj and nj, and returning to the step of judging whether the demodulation circuit has pulse output; if the demodulation circuit stops pulse output, the data content transmitted by the transmitting end in the form of character frames is determined according to the type of the character information determined one by one.
Wherein, demodulation circuit includes diode, first resistance, second resistance, third resistance, electric capacity and opto-coupler, and is specific:
the anode of the diode is connected with an output pin of the modulation circuit through a transmission line, and the cathode of the diode is connected with the anode of the input side of the optical coupler;
one end of the second resistor is used as a zero line wiring terminal, and the other end of the second resistor is connected with a cathode on the input side of the optical coupler;
the first resistor is connected between the anode and the cathode of the optical coupler input side;
an emitter and a collector of the output side of the optical coupler are grounded and serve as output pins of the demodulation circuit;
one end of the third resistor is connected with a collector at the output side of the optocoupler, and the other end of the third resistor is connected with a direct current source;
the capacitor is connected between the collector on the output side of the optical coupler and the ground.
A unidirectional communication system, comprising: 1 transmitting end and at least one receiving end, wherein:
a wire is used as a transmission line between the sending end and each receiving end;
the transmitting end is any one of the transmitting ends disclosed above, and the at least one receiving end is any one of the receiving ends disclosed above.
It can be seen from the above technical solutions that different transmission waveforms are used to represent different types of character information, the different transmission waveforms refer to different time relationships between sine wave output and no signal output on a modulated signal, and then different types of character information can be transmitted to a receiving end only by changing the time relationship, wherein whether the duration of sine wave output and the duration of no signal output reach respective set values is measured by the number of zero-crossing points of a sine alternating current signal input to a modulation circuit; the receiving end can identify different types of character information by demodulating different transmitted waveforms. Because the invention uses different transmission waveforms to represent different types of character information, the transmitting end can transmit the transmission waveforms to the receiving end by only using one conducting wire, the wiring is simple, the long-distance stable communication can be realized, and the problems in the prior art are solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1a-1b are flow charts of a method for sending a character frame according to an embodiment of the present invention;
FIG. 2a is a waveform diagram of a modulated signal characterizing low level bits of data according to an embodiment of the present invention;
FIG. 2b is a waveform diagram of a modulated signal representing high level bits of data according to an embodiment of the present invention;
FIG. 2c is a waveform diagram of a modulated signal characterizing a start bit according to an embodiment of the present invention;
FIG. 2d is a waveform diagram of a modulated signal characterizing a stop bit according to an embodiment of the present invention;
fig. 3 is a flowchart of a character frame receiving method according to a second embodiment of the present invention;
FIG. 4a is a waveform diagram of a demodulated signal representing low level bits of data according to a second embodiment of the present invention;
FIG. 4b is a waveform diagram of a demodulated signal representing a high level bit of data according to a second embodiment of the present invention;
FIG. 4c is a waveform diagram of a demodulated signal representing a start bit according to the second embodiment of the present invention;
FIG. 4d is a waveform diagram of a demodulated signal representing a stop bit according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a transmitting end disclosed in the third embodiment of the present invention;
fig. 6 is an input/output waveform diagram of a zero-crossing point detection circuit according to a third embodiment of the present invention;
fig. 7 is a schematic diagram of a topology of a demodulation circuit according to a fourth embodiment of the present invention;
fig. 8 is a schematic structural diagram of a unidirectional communication system according to a fifth embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
referring to fig. 1a-1b (fig. 1a is an outer loop, fig. 1b is an inner loop), the embodiment of the invention discloses a character frame sending method, which is applied to a sending end, wherein a modulation circuit in the sending end is provided with a sine alternating current signal input pin, so that long-distance stable communication under the condition of unidirectional communication is realized, and wiring is simplified.
The scheme shown in fig. 1a comprises:
step 100: acquiring a character frame to be sent, wherein the character frame comprises four types of character information, namely an initial bit, a data low level bit, a data high level bit, a stop bit and the like;
step 200: and controlling the modulation circuit to sequentially send each bit of character information in the character frame bit by bit until the last bit of character information is sent.
In asynchronous communication, data is transmitted by character frames formed by taking characters as units, and each character frame is sent by a sending end frame by frame and received by a receiving end frame by frame through a transmission line; each character frame is composed of four parts of start bit, data bit, parity check bit and stop bit, each bit of character information in any frame is transmitted bit by the transmitting end and received bit by the receiving end through the transmission line. The scheme shown in fig. 1a is a control method for transmitting any frame character frame.
The receiving end identifies each frame character frame transmitted frame by identifying each bit character information transmitted bit by bit, and further identifies the data transmitted in the character frame form, thereby completing the one-way communication. The data low level bit in step 100 refers to a low level logic "0" in two parts, i.e., the data bit and the parity bit, and the data low level bit in step 100 refers to a high level logic "1" in two parts, i.e., the data bit and the parity bit. The receiving end recognizes four types of character information, such as a start bit, a data low level bit, a data high level bit, a stop bit and the like, and also recognizes each bit of character information transmitted bit by bit.
In hardware design, a transmitting end converts a computer language into a modulated signal suitable for transmission by using a modulation circuit, and a receiving end converts the transmitted modulated signal into a recognizable computer language by using a demodulation circuit.
FIG. 1b is a control method for sending any bit of character information, including:
step 201: identifying the type of the local character information, wherein the different types of character information correspond to different mi values, and mi is a positive integer;
step 202: counting the number S of zero crossing points of the sinusoidal alternating current signals input into the modulation circuit;
step 203: judging whether S is more than or equal to 0 and less than 2mi +1, and if so, entering step 204; otherwise, go to step 205;
step 204: outputting a first level signal, wherein the first level signal is used for controlling the modulation circuit to output the sinusoidal alternating current signal; then, returning to step 203;
step 205: judging whether S is more than or equal to 2mi +1 and less than 2mi +1+2ni, and if so, entering the step 206; otherwise, go to step 207; wherein ni is a positive integer;
step 206: outputting a second level signal, wherein the second level signal is used for controlling the modulation circuit not to output; then, returning to step 205;
the first level signal may be set to be a low level logic "0" and the second level signal may be set to be a high level logic "1", or the second level signal may be set to be a low level logic "0" and the first level signal may be set to be a high level logic "1";
step 207: clearing S; and at this point, the sending of the local character information is finished.
The scheme shown in fig. 1b aims at representing different types of character information by using different transmission waveforms, wherein the different transmission waveforms refer to different time relationships between sine wave output and no-signal output on a modulated signal, so that different types of character information can be transmitted to a receiving end only by changing the time relationship, and whether the duration of the sine wave output and the duration of the no-signal output reach respective set values is measured by the number S of zero-crossing points of a sine alternating current signal input to a modulation circuit; the receiving end can identify different types of character information by demodulating different transmitted waveforms, and unidirectional communication is completed. The following examples are given.
Setting mi values corresponding to four types of character information, namely a data low level bit, a data high level bit, a start bit and a stop bit, as 1, 2, 3 and 4 respectively, and ni is 1, then:
1) the output waveform of the modulation circuit corresponding to the low level bit of the data occupies 2 sine wave periods in total, the sine wave is output in the first 1 sine wave period, and no signal is output in the last 1 sine wave period, as shown in fig. 2 a;
in FIG. 2a, VinRepresenting a sinusoidal AC signal, V, input to a modulation circuitoutA data low level bit representing the output of the modulation circuit; (i) - (v) represent 5 zero-crossing points, and one sine wave period T includes 3 zero-crossing points. When the modulated signal representing the low level bit of the data is required to be obtained, the time relation between sine wave output and no signal output on the output signal of the modulation circuit can be realized by only outputting the first level signal to the modulation circuit when S is more than or equal to 0 and less than 3 and outputting the second level signal to the modulation circuit when S is more than or equal to 3 and less than 5Controlling to be 1: 1.
2) the output waveform of the modulation circuit corresponding to the high level bit of the data occupies 3 sine wave periods in total, the sine wave is output in the first 2 sine wave periods, and no signal is output in the last 1 sine wave period, as shown in fig. 2 b;
in FIG. 2b, VinRepresenting a sinusoidal AC signal, V, input to a modulation circuitoutA data high level bit representing the output of the modulation circuit; phi-phi represent zero crossing points. When the modulated signal representing the high level bit of the data is required to be obtained, the time relation between the sine wave output and the no signal output on the output signal of the modulation circuit can be controlled to be 2 only by outputting the first level signal to the modulation circuit when S is more than or equal to 0 and less than 5 and outputting the second level signal to the modulation circuit when S is more than or equal to 5 and less than 7: 1.
3) the output waveform of the modulation circuit corresponding to the start bit occupies 4 sine wave periods in total, the sine wave is output in the first 3 sine wave periods, and no signal is output in the last 1 sine wave period, as shown in fig. 2 c;
in FIG. 2c, VinRepresenting a sinusoidal AC signal, V, input to a modulation circuitoutA start bit representing an output of the modulation circuit; (i) - (ninthly) represent zero crossing points. When the modulated signal representing the start bit is required to be obtained, the time relation between sine wave output and no signal output on the output signal of the modulation circuit can be controlled to be 3 only by outputting the first level signal to the modulation circuit when S is more than or equal to 0 and less than 7 and outputting the second level signal to the modulation circuit when S is more than or equal to 7 and less than 9: 1.
4) the modulation circuit output waveform corresponding to the stop bit occupies 5 sine wave periods in total, the sine wave is output in the first 4 sine wave periods, and no signal is output in the last 1 sine wave period, as shown in fig. 2 d;
in FIG. 2d, VinRepresenting a sinusoidal AC signal, V, input to a modulation circuitoutA stop bit representing the output of the modulation circuit;
Figure BDA0001187257340000081
representing the zero crossing. When the modulated signal representing the stop bit is required to be obtained, the modulation circuit is only required to be switched to when S is more than or equal to 0 and less than 9Outputting the first level signal, and outputting the second level signal to the modulation circuit when S is more than or equal to 9 and less than 11, namely, controlling the time relation between sine wave output and no signal output on the output signal of the modulation circuit to be 4: 1.
the receiving end can identify different types of character information by identifying four different transmission waveforms in fig. 2 a-2 d, and thus, unidirectional communication is completed. It should be noted that mi and ni respectively represent the number of sine wave cycles with sine wave output and the number of sine wave cycles without signal output, and since the smaller the values of mi and ni, the shorter the modulation time, the embodiment of the present invention takes mi ≦ 4 and ni ≦ 1 as preferred embodiments, but not limited thereto.
It can be seen from the above description that, in this embodiment, different transmission waveforms are used to represent different types of character information, so that the transmitting end can transmit the transmission waveforms to the receiving end only by using one wire, the wiring is simple, long-distance stable communication can be realized, and the problems in the prior art are solved.
Example two:
referring to fig. 3, an embodiment of the present invention discloses a character frame receiving method, which is applied to a receiving end, where a demodulation circuit in the receiving end is used for receiving a character frame when an input voltage is equal to V0Time-reversal level (the demodulation circuit can be set to be lower than V when the input voltage is lower than V)0Time-out low level, when input voltage is not less than V0The high level is output at any time, or the demodulation circuit can be set to output when the input voltage is less than V0Time-out high level, when input voltage is not less than V0Time out low level), V0The method is more than or equal to 0 so as to realize long-distance stable communication and simplify wiring under the unidirectional communication occasion, and comprises the following steps:
step 301: judging whether the demodulation circuit has pulse output; if the demodulation circuit has a pulse output, go to step 302; if the demodulation circuit stops outputting pulses, go to step 306;
step 302: counting the number mj and nj of short pulses and long pulses output by the demodulation circuit;
step 303: judging whether nj is equal to ni or not; if yes, go to step 304; otherwise, returning to step 302;
step 304: determining the type of the character information uniquely corresponding to the mj value;
step 305: clearing mj and nj, and then returning to the step 301;
step 306: and determining the data content transmitted by the transmitting end in a character frame form according to the type of the character information determined one by one.
The scheme shown in fig. 3 is intended to determine the type of character information uniquely corresponding to mi value according to mi value, and is exemplified as follows:
firstly, the demodulation circuit is set to be in a state that the input voltage is less than V0Time-out high level, when input voltage is not less than V0Outputting a low level; setting mi values corresponding to four types of character information, namely a data low level bit, a data high level bit, a start bit and a stop bit as 1, 2, 3 and 4 respectively, and setting ni to be 1; resetting the input and output signals of the demodulation circuit to be U respectivelyin、UoutAnd then:
1) when U is turnedinWhen the one-bit data is low, UoutA signal wave with 0 short pulses output first and 1 long pulse output later is shown in fig. 4 a; in FIG. 4a, UoutAnd UinHas the same waveform length and is 2T (T represents a sine wave circulator);
2) when U is turnedinWhen one bit data is high, UoutA signal wave in which 1 short pulse is output first and 1 long pulse is output later is shown in fig. 4 b; in FIG. 4b, UoutAnd UinThe waveform lengths of (a) and (b) are equal and 3T;
3) when U is turnedinWhen it is a one-bit start bit, UoutA signal wave with 2 short pulses output first and 1 long pulse output later is shown in fig. 4 c; in FIG. 4c, UoutAnd UinThe waveform lengths of (a) and (b) are equal and 4T;
4) when U is turnedinAt one stop position, UoutA signal wave in which 3 short pulses are output first and 1 long pulse is output later is shown in fig. 4 d; in FIG. 4d, UoutAnd UinThe waveform lengths of (a) and (b) are equal and 5T;
therefore, the pulse combination of 'mj short pulses + nj long pulses' corresponds to one bit of character information, the short pulses are output at the front, the long pulses are output at the back, and when nj equals ni, the transmission of one bit of character information is completed; the type of the character information corresponding to mj values is different, so that the type of the character information corresponding to the pulse combination of 'mj short pulses + nj long pulses' can be determined by the mi value after the transmission of one-bit character information is completed.
Example three:
referring to fig. 5, an embodiment of the present invention discloses a transmitting end to implement long-distance stable communication and simplify wiring in a unidirectional communication situation, including a zero-crossing point detection circuit 100, a modulation circuit 200, and a first control unit not shown in fig. 5, wherein;
the zero-crossing point detection circuit 100 has a sine alternating current signal input pin for converting an input sine alternating current signal into a pulse signal, wherein the number of pulses is equal to the number of zero-crossing points of the sine alternating current signal; an output pin Zero Cross of the Zero crossing point detection circuit 100 is connected with the first control unit;
the first control unit is used for acquiring a character frame to be sent, wherein the character frame comprises four types of character information, namely a start bit, a data low level bit, a data high level bit, a stop bit and the like; controlling the modulation circuit to sequentially send each bit of character information in the character frame bit by bit until the last bit of character information is sent; the method for controlling the modulation circuit to transmit any bit character information in the character frame comprises the following steps: identifying the type of the local character information, wherein different types of character information correspond to different mi values, mi is a positive integer, counting the number S of zero crossing points of a sinusoidal alternating current signal input into the modulation circuit, outputting a modulation signal according to the S value, ending and resetting S until S is 2mi +1+2ni, wherein ni is a positive integer; wherein, the outputting a modulation signal according to the S value includes: when S is more than or equal to 0 and less than 2mi +1, a first level signal is output, and when S is more than or equal to 2mi +1 and less than 2mi +1+2ni, a second level signal is output;
the modulation circuit 200 has a Control Signal input pin Control Signal and a sinusoidal alternating current Signal input pin, wherein the Control Signal input pin is configured to receive the first level Signal and the second level Signal, the first level Signal is configured to Control the modulation circuit to output the sinusoidal alternating current Signal, and the second level Signal is configured to Control the modulation circuit not to output.
Wherein, still referring to fig. 5, the zero crossing point detection circuit 100 includes a resistor R510, a photo-isolation bidirectional thyristor U501, and a resistor R513, wherein:
one end of the resistor R510 serves as a live wire terminal LINE, and the other end of the resistor R is connected with a first input terminal 1 of the photoelectric isolation bidirectional thyristor U501;
a second input terminal 2 of the photoelectric isolation bidirectional thyristor U501 is used as a zero line wiring terminal NEUTRAL;
a collector 3 at the output side of the photoelectric isolation bidirectional thyristor U501 is connected with a direct current source VCC1 through a resistor R513, and the collector 3 is used as an output pin Zero Cross of the Zero crossing detection circuit 100; the emitter 4 of the output side of the photo-isolating triac U501 is grounded.
The live wire terminal LINE and the zero LINE terminal NEUTRAL are sine alternating current signal input pins of the zero crossing point detection circuit 100. The operating principle of the zero crossing point detection circuit 100 is as follows: the resistor R510 is a current-limiting resistor, and the resistor R513 is a pull-up resistor; the photo-isolation bidirectional thyristor U501 is turned on when the amplitude of the input voltage is higher than a set threshold (i.e., the collector 3 and the emitter 4 are turned on), and turned off when the amplitude of the input voltage is lower than the set threshold; after the photoelectric isolation bidirectional thyristor U501 is turned off, the Zero Cross output pin Zero Cross of the detection circuit 100 outputs a high level, and after the photoelectric isolation bidirectional thyristor U501 is turned on, the Zero Cross output pin Zero Cross of the detection circuit 100 is pulled low, as shown in fig. 6. As can be seen from fig. 6, the pulse number is the number of zero-crossing points of the sinusoidal ac electrical signal, and thus the first control unit can count the number of zero-crossing points of the sinusoidal ac electrical signal by counting the pulse number.
Optionally, the zero-crossing point detection circuit 100 further includes an input filter circuit and/or an output filter circuit; the input filter circuit is used for absorbing peak voltage interference signals on the input side of the photoelectric isolation bidirectional thyristor U501, and the output filter circuit is used for absorbing peak voltage interference signals on the input side of the photoelectric isolation bidirectional thyristor U501. Still referring to fig. 5, the input filter circuit may include a resistor R516 and a capacitor C511; the resistor R516 and the capacitor C511 are both connected between the first input pin 1 and the second input pin 2 of the photo-isolating triac U501. Still referring to fig. 5, the output filter circuit may include a resistor R515 and a capacitor C512; the first end of the resistor R515 is connected with the collector 3 at the output side of the photoelectric isolation bidirectional thyristor U501, and the second end of the resistor R515 is connected with an output pin Zero Cross of the Zero-crossing detection circuit 100; the capacitor C512 is connected between the second end of the resistor R515 and ground.
In addition, before controlling the modulation circuit 200 to transmit data, the first control unit may perform frequency verification on the sinusoidal alternating current signal input to the transmitting end by detecting the output frequency of the zero-crossing point detection circuit 100, and if the output frequency of the zero-crossing point detection circuit 100 is abnormal, the sinusoidal alternating current signal input to the transmitting end is considered invalid.
Wherein, still referring to fig. 5, the modulation circuit 200 includes a resistor R512, a resistor R523, a photo-isolation triac U502, and a triac Z503, wherein:
the anode of the input side of the photoelectric isolation bidirectional thyristor U502 is connected with a direct current source VCC1 through a resistor R521;
the cathode of the input side of the photoelectric isolation bidirectional thyristor U502 is used as a Control Signal input pin Control Signal of the modulation circuit 200;
one end of the resistor R523 serves as a live wire terminal LINE, and the other end of the resistor R523 is connected with a first output terminal 5 on the output side of the photoelectric isolation bidirectional thyristor U502;
an input electrode 7 of the bidirectional thyristor Z503 is connected with a first output terminal 5 at the output side of the photoelectric isolation bidirectional thyristor U502, a control electrode 8 of the bidirectional thyristor Z503 is connected with a second output terminal 6 at the output side of the photoelectric isolation bidirectional thyristor U502, and an output electrode 9 of the bidirectional thyristor Z503 is used as an output pin modulation Signal of the modulation circuit 200.
The operating principle of the modulation circuit 200 is as follows: the resistor R521 and the resistor R523 are both current-limiting resistors; when the Control Signal input pin Control Signal of the modulation circuit 200 inputs a low level, the bidirectional thyristor U502 is turned on (i.e., the first output terminal 5 and the second output terminal 6 of the bidirectional thyristor U502 are turned on), and the bidirectional thyristor Z503 is turned on after the U502 is turned on (i.e., current flows from the input electrode 7 of the bidirectional thyristor Z503 to the output stage 9), so that the output pin modulation Signal of the modulation circuit 200 outputs a sinusoidal alternating current Signal; when the Control Signal input pin Control Signal of the modulation circuit 200 inputs a high level, the photoelectric isolation bidirectional thyristor U502 is turned off, and the bidirectional thyristor Z503 is turned off after the U502 is turned off, so that the modulation Signal at the output pin of the modulation circuit 200 has no Signal output.
Corresponding to the above topology of the modulation circuit 200, the first level signal output by the first control unit should be a low level logic "0", and the second level signal should be a high level logic "1".
Optionally, still referring to fig. 5, the modulation circuit 200 further includes an output filter circuit, which may include a resistor R522 and a capacitor C515; the resistor R522 and the capacitor C515 are connected in series between the input terminal 7 and the output stage 9 of the triac Z503.
Example four:
the embodiment of the invention discloses a receiving end, which is used for realizing long-distance stable communication and simplifying wiring under the situation of unidirectional communication and comprises a second control unit and a demodulation circuit, wherein:
the demodulation circuit is used for receiving the input voltage equal to V0Time-reversal level, V0≥0;
The output pin of the demodulation circuit is connected with the second control unit;
the second control unit is used for judging whether the demodulation circuit has pulse output; if the demodulation circuit outputs pulses, counting the number mj and nj of short pulses and long pulses output by the demodulation circuit; when nj is ni, determining the type of the character information uniquely corresponding to the mj value; then, resetting mj and nj, and returning to the step of judging whether the demodulation circuit has pulse output; if the demodulation circuit stops pulse output, the data content transmitted by the transmitting end in the form of character frames is determined according to the type of the character information determined one by one.
The topological structure of the demodulation circuit is shown in fig. 7, and includes a diode D6, a resistor R79, a resistor R80, a resistor R74, a capacitor C69, and an optocoupler PC1, where:
the anode of the diode D6 is connected with the output pin modulation Signal of the modulation circuit 200 through a transmission line, and the cathode of the diode D6 is connected with the anode of the input side of the optical coupler PC 1;
one end of the resistor R80 is used as a NEUTRAL wire terminal NEUTRAL, and the other end of the resistor R80 is connected with the cathode of the input side of the optocoupler PC 1;
the resistor R79 is connected between the anode and the cathode at the input side of the optocoupler PC 1;
an emitter 11 at the output side of the optical coupler PC1 is grounded, and a collector 10 is used as an output pin demodulation Signal of the demodulation circuit;
one end of the resistor R74 is connected with the collector 10 at the output side of the optical coupler PC1, and the other end is connected with a direct current source VCC 2;
the capacitor C69 is connected between the collector 10 on the output side of the optocoupler PC1 and ground.
The working principle of the demodulation circuit is as follows:
the diode D6 is used for half-wave rectification; the resistor R80 is a current-limiting resistor; the resistor R79 is used for preventing the reverse voltage of the input loop of the optocoupler PC1 from exceeding the rated reverse breakdown voltage of the input loop; the resistor R74 and the capacitor C69 form an RC charge-discharge circuit, the duty ratio can be effectively set by adjusting the resistor R74 and the capacitor C69, and the RC charge-discharge circuit can also play a role in filtering. When the input voltage of the demodulation circuit is less than V0When the voltage is high, the cathode of the diode D6 is at a low level, the optocoupler PC1 is turned off, and the demodulation Signal of the demodulation circuit outputs a high level; when the input voltage of the demodulation circuit is not less than V0When the cathode of the diode D6 is at a low level, the optocoupler PC1 is turned on, and the demodulation Signal of the demodulation circuit is pulled low.
Therefore, the demodulation circuit with the topological structure has the input voltage less than V0Time-out high level, when input voltage is not less than V0The time goes low.
Example five:
referring to fig. 8, a fifth embodiment of the present invention discloses a unidirectional communication system, which includes 1 transmitting end and N (N is greater than or equal to 1) receiving ends, wherein a conducting wire is used as a transmission line between the transmitting end and each receiving end; the transmitting end is any one of the transmitting ends disclosed in the third embodiment; the receiving end is any one of the receiving ends disclosed in the fourth embodiment, so that the linkage control of one host computer to N slave computers is realized, long-distance stable communication can be realized between the host computer and the slave computers, only one transmission line is needed, and the wiring is very simple. Compared with an I2C bus, an SPI bus, an RS485 bus, a TTL asynchronous serial communication mode, and the like, when the transmitting end disclosed in the third embodiment and the receiving end disclosed in the fourth embodiment are applied to a one-way communication system with one master and multiple slaves, the advantage of simple system wiring is particularly obvious.
In summary, different transmission waveforms are used to represent different types of character information, where the different transmission waveforms refer to different time relationships between sine wave output and no-signal output on a modulated signal, and then different types of character information can be transmitted to a receiving end by changing the time relationship, where whether the duration of sine wave output and the duration of no-signal output reach respective set values are both measured by the number of zero-crossing points of a sine alternating current signal input to a modulation circuit; the receiving end can identify different types of character information by demodulating different transmitted waveforms. Because the invention uses different transmission waveforms to represent different types of character information, the transmitting end can transmit the transmission waveforms to the receiving end by only using one conducting wire, the wiring is simple, the long-distance stable communication can be realized, and the problems in the prior art are solved.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the embodiments. Thus, the present embodiments are not intended to be limited to the embodiments shown herein but are to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (4)

1. A sending end is characterized by comprising a zero-crossing detection circuit, a modulation circuit and a first control unit, wherein the zero-crossing detection circuit is used for detecting the zero-crossing of a signal;
the zero-crossing point detection circuit is provided with a sine alternating current signal input pin and is used for converting an input sine alternating current signal into pulse signals, and the number of the pulses is equal to the number of zero-crossing points of the sine alternating current signal; the output pin of the zero-crossing detection circuit is connected with the first control unit;
the first control unit is used for acquiring a character frame to be sent, wherein the character frame comprises four types of character information including a start bit, a data low level bit, a data high level bit and a stop bit; controlling the modulation circuit to sequentially send each bit of character information in the character frame bit by bit until the last bit of character information is sent; the method for controlling the modulation circuit to transmit any bit character information in the character frame comprises the following steps: identifying the type of the local character information, wherein different types of character information correspond to different mi values, mi is a positive integer, counting the number S of zero crossing points of a sinusoidal alternating current signal input into the modulation circuit, outputting a modulation signal according to the S value, ending and resetting S until S is 2mi +1+2ni, wherein ni is a positive integer; wherein, the outputting a modulation signal according to the S value includes: when S is more than or equal to 0 and less than 2mi +1, a first level signal is output, and when S is more than or equal to 2mi +1 and less than 2mi +1+2ni, a second level signal is output;
the modulation circuit is provided with a sine alternating current signal input pin and a control signal input pin, wherein the control signal input pin is used for receiving the first level signal and the second level signal, the first level signal is used for controlling the modulation circuit to output the sine alternating current signal, and the second level signal is used for controlling the modulation circuit not to output;
the zero crossing point detection circuit comprises a first resistor, a photoelectric isolation bidirectional thyristor and a second resistor, wherein:
one end of the first resistor is used as a live wire connecting terminal, and the other end of the first resistor is connected with a first input terminal of the photoelectric isolation bidirectional thyristor;
a second input terminal of the photoelectric isolation bidirectional thyristor is used as a zero line wiring terminal;
a collector electrode at the output side of the photoelectric isolation bidirectional thyristor is connected with a direct current source through the second resistor, and the collector electrode is used as an output pin of the zero-crossing detection circuit; the emitting electrode at the output side of the photoelectric isolation bidirectional thyristor is grounded;
the live wire connecting terminal and the zero line connecting terminal are sine alternating current signal input pins of the zero-crossing detection circuit;
the modulation circuit comprises a first resistor, a second resistor, a photoelectric isolation bidirectional thyristor and a bidirectional thyristor, wherein:
the anode of the input side of the photoelectric isolation bidirectional thyristor is connected with a direct current source through the first resistor;
the cathode of the input side of the photoelectric isolation bidirectional thyristor is used as a control signal input pin of the modulation circuit;
one end of the second resistor is used as a live wire connecting terminal, and the other end of the second resistor is connected with a first output terminal on the output side of the photoelectric isolation bidirectional thyristor;
the input electrode of the bidirectional controllable silicon is connected with a first output terminal at the output side of the photoelectric isolation bidirectional thyristor, the control electrode of the bidirectional controllable silicon is connected with a second output terminal at the output side of the photoelectric isolation bidirectional thyristor, and the output electrode of the bidirectional controllable silicon is used as an output pin of the modulation circuit.
2. A transmitting end according to claim 1, characterized in that mi is equal to or less than 4 and ni is equal to 1.
3. A receiving end, comprising a second control unit and a demodulation circuit, wherein:
the demodulation circuit is used for receiving the input voltage equal to V0Time-reversal level, V0≥0;
The output pin of the demodulation circuit is connected with the second control unit;
the second control unit is used for judging whether the demodulation circuit has pulse output; if the demodulation circuit outputs pulses, counting the number mj and nj of short pulses and long pulses output by the demodulation circuit; when nj is equal to ni as recited in claim 1 or 2, determining a type of character information uniquely corresponding to the mj value; then, resetting mj and nj, and returning to the step of judging whether the demodulation circuit has pulse output; if the demodulation circuit stops pulse output, determining the data content transmitted by the transmitting end in a character frame form according to the type of the character information determined one by one;
demodulation circuit includes diode, first resistance, second resistance, third resistance, electric capacity and opto-coupler, wherein:
the anode of the diode is connected with an output pin of the modulation circuit through a transmission line, and the cathode of the diode is connected with the anode of the input side of the optical coupler;
one end of the second resistor is used as a zero line wiring terminal, and the other end of the second resistor is connected with a cathode on the input side of the optical coupler;
the first resistor is connected between the anode and the cathode of the optical coupler input side;
an emitter and a collector of the output side of the optical coupler are grounded and serve as output pins of the demodulation circuit;
one end of the third resistor is connected with a collector at the output side of the optocoupler, and the other end of the third resistor is connected with a direct current source;
the capacitor is connected between the collector on the output side of the optical coupler and the ground.
4. A unidirectional communication system, comprising: 1 transmitting end and at least one receiving end, wherein:
a wire is used as a transmission line between the sending end and each receiving end;
the transmitting end is the transmitting end of claim 1 or 2, and the at least one receiving end is the receiving end of claim 3.
CN201611191996.4A 2016-12-21 2016-12-21 Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system Active CN106850132B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611191996.4A CN106850132B (en) 2016-12-21 2016-12-21 Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611191996.4A CN106850132B (en) 2016-12-21 2016-12-21 Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system

Publications (2)

Publication Number Publication Date
CN106850132A CN106850132A (en) 2017-06-13
CN106850132B true CN106850132B (en) 2020-12-15

Family

ID=59135114

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611191996.4A Active CN106850132B (en) 2016-12-21 2016-12-21 Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system

Country Status (1)

Country Link
CN (1) CN106850132B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242351B (en) * 2022-07-13 2024-02-13 厦门九华通信设备厂 Self-adaptive method for serial data communication rate

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101719310B (en) * 2009-12-21 2011-06-08 山东大学 Long-distance infrared remote-controlled device and method used for embedded equipment
CN105528887A (en) * 2014-09-29 2016-04-27 中山市中大半导体照明技术研究有限公司 Method for controlling alternating current digital coding

Also Published As

Publication number Publication date
CN106850132A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106941349A (en) A kind of low delay optical coupling isolation circuit and RS485 isolate telecommunication circuit
CN103684943A (en) Bus system with power supply transmission and data communication functions
CN102185805B (en) M-BUS (Meter-Bus) driving circuit
CN206629064U (en) A kind of device for power line carrier communications
CN106850132B (en) Character frame transmitting/receiving method, transmitting/receiving end and one-way communication system
CN109597783A (en) A kind of double light-coupled isolation type RS485 circuits
CN103118143B (en) Multiplex circuit of serial interface and Ethernet interface
CN213957869U (en) Internet gateway circuit
CN205283099U (en) Servo motor undervoltage protection device
CN202518896U (en) Photoelectric switch for elevator
CN112073087A (en) Alternating current power grid communication circuit, electrical equipment, communication system and method
CN202841552U (en) Wireless signal forwarding device
CN206178380U (en) Switching value acquisition circuit
CN205610628U (en) A signal transceiver circuits for flight controller
CN204556766U (en) LVDS opens short-circuit detecting device
CN210780784U (en) Low-cost direct current carrier circuit system
CN209375659U (en) Optical module and optical communication equipment
CN203164750U (en) M-BUS bus monitoring circuit
CN108924025B (en) Energy-carrying field bus module and system thereof
CN212413152U (en) Alternating current power grid communication circuit, electrical equipment and communication system
CN203838509U (en) Micro-power consumption M-bus slave computer end circuit for intelligent instrument communication
CN208622086U (en) A kind of serial communication interface circuit
CN201393232Y (en) Bus communication circuit applying novel CMI encoding
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
CN105991160B (en) A kind of signal processing apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant