CN105208021B - A kind of data communication method and its system - Google Patents
A kind of data communication method and its system Download PDFInfo
- Publication number
- CN105208021B CN105208021B CN201510583365.6A CN201510583365A CN105208021B CN 105208021 B CN105208021 B CN 105208021B CN 201510583365 A CN201510583365 A CN 201510583365A CN 105208021 B CN105208021 B CN 105208021B
- Authority
- CN
- China
- Prior art keywords
- data
- target device
- bits
- frame
- transmission mode
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/387—Information transfer, e.g. on bus using universal interface adapter for adaptation of different data processing systems to different peripheral devices, e.g. protocol converters for incompatible systems, open system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Communication Control (AREA)
Abstract
The present invention relates to a kind of data communication method and its systems, and wherein data communication method is applied in the data communication system being made of the monobus of source device, target device and connection source device and target device.Data frame is sent to target device according to preset transport protocol, by monobus by source device;Target device receives data frame, is decoded one by one, obtains one or more number of bits evidences;Target device is according to one or more number of bits according to progress corresponding operation;When data communication system is in data-transmission mode and when one or more number of bits of target device acquisition are according to being the first particular sequence code, target device enters control transmission mode;When data communication system is in control transmission mode and when one or more number of bits of target device acquisition are according to being the second particular sequence code, target device exits control transmission mode, into data-transmission mode.The present invention using single signal wire, agreement is simple and hardware spending is few.
Description
Technical field
The present invention relates to field of communication technology more particularly to a kind of data communication method and its systems.
Background technique
In order to simplify circuit system interface complexity interconnected and reduce the wiring cost of printed board, in most of realities
When property is of less demanding and the lower electronic system of transmission speed in, it is logical between source device (Host) and target device (Device)
News often use serial communication mode, and its advantages are that signal wire is few, it can be achieved that remote transmission.Target device is typically special
The functional peripheral components belonged to consider from the overall cost of software and hardware for realizing some or certain several specific functions,
This circuit is suitable for realizing sending and receiving for serial communication interface with hardware circuit.
Such as source device drives LED display module in cell phone system, mainly sets to the output size of current of LED
It sets, to change its display brightness.The transmission demand of this data is related to concrete application, only needs to change LED in user bright
When spending, host just can drive display module to carry out data transmission with LED, and transmission process is often in several ms or hundreds of millis
It is completed in the time of second.The application of this communication interface only carries out simple data transmission, i.e. transmission contains luminance information
The rate request of data, real-time and transmission to data transmission is not high.
But in circuit realization, will often target device be initialized by powering on rear source device, specific function configuration, or
Person carries out parameter regulation to variable amounts certain in target device.Such as the internal register by the way that target device is arranged, configuration
The suitable operation such as transmission rate and initialization procedure (timing), to reach scheduled perfect condition, is then counted again
According to transmission.Or the free time section that source device is transmitted in data, the internal state for reading target device are analyzed, then again
Its relevant variable is reset, to adapt to new working environment, or parameter correction is carried out to target device again, so that its
The working condition for being optimal.
At present in circuit system, more common and less line serial line interface is mainly I2C and SPI.Wherein I2C is two lines
System, communications protocol is more complicated.SPI needs 3 to 4 signal wires, and interface links are more, have in practical applications certain
Limitation.As described above, if other than the serial communication interface for being used for transmission data, being further added by such electronic system
Dedicated for the communication interface or serial line interface for configuring or controlling, it is necessarily required to increase or use very limited pin resource,
This number that will lead to interface signal line increases, and significantly increases chip cost and printed board cost, and periphery needs therewith
The slave equipment of interface will also increase.
The data communication method of the prior art is disadvantageous in that:
1. data transmission interface and control interface are often individual dual serial interface;
2. using at least 2 signal wires, agreement is compared with parallel interface complexity;
3. periphery is interfacing more from equipment.
Single Wire Bus Technology, different from above-mentioned bus, it is realized between source device and target device using single signal wire
Communication, structure and design are simple, and hardware spending is few, and easy communication, wiring cost is low, and are convenient for bus extension and maintenance, non-
Often suitable for the circuit system of this simple low speed.
In practical application, system is connected than more typical monobus hardware, such as shown in Fig. 1, prior art monobus number
The peripheral Serial Extension bus that Dallas company releases according to communication system schematic diagram, an only radical according to input/output line,
Can be by 1 I/O mouth line of source device as data input/output line, all devices are all hung on this root line.Monobus is sought
Location and data transmission have stringent timing sequence specification.
Summary of the invention
The purpose of the present invention is to solve in place of above-mentioned the shortcomings of the prior art, transmitted in current single bus data
On the basis of, a kind of data communication method and its system are provided, by the transmission of data and the transmission of signal is controlled, by customized
One exclusive software protocol is physically used in conjunction with or is multiplexed a signal wire in hardware to distinguish to transmit.
To achieve the above object, on the one hand, the present invention provides a kind of data communication method, this method is applied to be set by source
In standby, target device, and the data communication system that constitutes of monobus of the connection source device and target device, this method packet
Include following steps:
Data frame is sent to target device according to preset transport protocol, by monobus by source device, wherein counting
It is made of according to frame one or more bits;Target device receives data frame, is decoded one by one, obtains one or more bits
Position data;
Target device is according to one or more number of bits according to progress corresponding operation;
When data communication system is in data-transmission mode and target device obtain one or more number of bits
When according to for the first particular sequence code, target device enters control transmission mode;
When data communication system be in control transmission mode when and the target device obtain it is one or more of
When number of bits is according to being the second particular sequence code, target device exits control transmission mode, into data-transmission mode.
Preferably, data frame includes start of frame bits, data bit, frame end position;Wherein, start of frame bits is one or more positions
The cycle time of data;Data bit includes one or more number of bits evidences, and data are according to uimsbf unsigned integer most significant bit first, the posterior sequence of low level
Transmit by turn or data according to low level formerly, high-order posterior sequence transmits by turn;Frame end position is the first level to second
Level transitions and the cycle time for keeping a bit data of the time of second electrical level greater than 5 times;Frame end position is used to indicate
One data frame completes transmission, and target device can load and handle data.
Preferably, after source device completes a data frame transmission, start the transmission of next data frame at any time;Or source is set
The second electrical level of standby control monobus output certain time, as the interval between data frame.
Preferably, after target device enters control transmission mode, target device solves received data frame one by one
Code obtains one or more number of bits evidences, determines control frame head in from one or more number of bits, according to control frame head
Configure the control mode of target device;
Control mode includes directly controlling mode and indirectly controlling mode.
Preferably, the decoding rule of data frame includes: when a data bit high level lasting time tH and a data bit
When the low level duration tL meets tL > 2*tH, a data bit period signal designation one effective low-level data 0;When one
When a data bit high level lasting time tH and a data bit the low level duration tL meet tH > 2*tL, a data bit
Periodic signal indicates an effective high level data 1.
Preferably, a data bit high level lasting time tH and one data bit the low level duration tL need to expire
Foot: TL < tL+tH < TH, wherein TH is first time threshold, and TL is second time threshold, and TH is greater than TL;
First time threshold TH and second time threshold TL is to confer preset numerical value jointly by source device and target device,
As unit of system clock cycle, second threshold value TL is not less than the system by first time threshold TH and second time threshold TL
4 times of clock.
Preferably, message transmission rate depends on the driving capability and data-handling capacity of source device or target device.
Preferably, the first level is low level, and second electrical level is high level or the first level is high level, the second electricity
It puts down as low level.
On the other hand, the present invention provides a kind of data communication system, the system include: source device, target device and
Connect the monobus of source device and target device, wherein
Source device, for data frame to be sent to target device by monobus according to preset transport protocol, number
It is made of according to frame one or more bits;
Target device is decoded one by one for receiving the data frame, obtains one or more number of bits evidences;
Target device is according to one or more number of bits according to progress corresponding operation;
When data communication system is in data-transmission mode and target device obtain one or more number of bits
When according to for the first particular sequence code, target device enters control transmission mode;
When data communication system be in control transmission mode when and target device obtain one or more number of bits
When according to for the second particular sequence code, target device exits control transmission mode, into data-transmission mode.
The present invention uses single signal wire, and agreement is simple, and system hardware expense is few, and wiring cost is low and can be by serial communication
Advantage bring into play completely.
Detailed description of the invention
Fig. 1 is prior art single bus data communication system schematic diagram;
Fig. 2 is a kind of data communication method flow diagram provided in an embodiment of the present invention;
Fig. 3 is data frame structure schematic diagram provided in an embodiment of the present invention;
Fig. 4 is data frame decoding rule schematic diagram provided in an embodiment of the present invention;
Fig. 5 is a kind of implementation steps of data communication method shown in Fig. 2;
Fig. 6 is another implementation steps of data communication method shown in Fig. 2;
Fig. 7 is another implementation steps of data communication method shown in Fig. 2;
Fig. 8 is another implementation steps of data communication method shown in Fig. 2.
Specific embodiment
Specific embodiments of the present invention are described below in conjunction with attached drawing.However, it should be understood that being retouched below to specific embodiment
It states just for the sake of explaining execution example of the invention, without carrying out any restriction to the scope of the present invention.
Fig. 2 is a kind of data communication method flow diagram provided in an embodiment of the present invention, and this method is applied to be set by source
In the data communication system that the monobus of standby, target device and the connection source device and target device is constituted.Such as Fig. 2 institute
Show, the method comprising the steps of S101-S107:
In step S101, data frame is sent to target according to preset transport protocol, by monobus by source device
Equipment, the data frame are made of one or more bits.
Above-mentioned preset transport protocol includes data frame structure, data frame transfer sequence and data frame decoding rule
Deng.
Data frame structure is as shown in figure 3, the data frame includes start of frame bits (Data Start), data bit (Data
Byte), frame end position (End Of Data).Wherein, start of frame bits (Data Start) is defined in frame format, to continue one
The high level fixed time, such as the cycle T of a position information;Frame end position is defined in frame format, is two low to high electricity
Flat process.When monobus is become high level and is kept for the time of high level be greater than 5 times of position T information cycle from low level,
Indicate that a frame completes transmission, i.e., the current serial frame end of transmission, target device can be loaded and be handled data with this.Data bit with
Low level starts, and when monobus becomes low level, i.e. failing edge from high level, is designated as the interval of two data bit, also makees
Start for the input operation of next bit data, target device may determine that data bit level is 1 or 0, and carry out displacement reception
Operation.
Each frame contains 8 bits in embodiment, and the sequence of data frame transfer shown in Fig. 3 is high-order (MSB)
Prioritised transmission, wherein D7, D6, D5, D4, D3, D2, D1, D0 are effective serial data, and in above scheme, data are existed with a high position
First, the posterior sequence of low level is transmitted by turn.Source device first sends high position data, retransmits low data, target device is with low level
Register receives nearest position data, and former data are successively shifted to high register.As the variants of agreement, according to
Need to define data with low level formerly, high-order posterior sequence transmit by turn, i.e., data frame transfer sequence or
Low level (LSB) prioritised transmission.
One complete frame transmission process is defined as:
Data Start (DS)=> D7=> D6=> D5=> D4=> D3=> D2=> D1=> D0=> Data Of End
(EOD)。
In step S102, target device receives the data frame, is decoded one by one, obtains one or more of bits
Position data.
Above-mentioned data frame decoding rule is as shown in figure 4, the wherein 400 the low level duration t for indicating data 0L_LB, 401
Indicate the high level lasting time t of data 0H_LB, 410 indicate the low level duration t of data 1L_HB, 411 indicate data 1
High level lasting time tH_HB.Definition signal period low and high level duration is T, and high level lasting time is in each cycle
TH, the low level duration tL, then have T=tL+tH.
Define first time threshold TL, it is desirable that the duration of cycle T should be greater than TL;
Define second time threshold TH, it is desirable that the duration of cycle T should be less than TH;
If tL is greater than 2*tH, and TL < tL+tH < TH, then an effective low-level data 0 is designated as;
If tH is greater than 2*tL, and TL < tL+tH < TH, then an effective high level data 1 is designated as;
In a source device and a target device, it is defined according to four above-mentioned rules, the signal of monobus input is solved
Code, can be obtained effective number of bits evidence.
In above scheme, time threshold TH/TL is a number that is preset, being conferred jointly by source device and target device
Value, TH are greater than TL, and time threshold TH/TL is the time threshold as unit of system clock cycle.System clock cycle is smaller, threshold
It is worth smaller, then message transmission rate is higher.But transmission rate will receive source device or target device data-driven ability and
Processing capacity limitation, it is preferable that t in the present embodimentL_HBTime greater than 4us.
In terms of specific implementation, time threshold TL generally not preferably less than 4 times of system clock cycle;When source device or target
When the system clock definition of equipment is not very accurate, it may be considered that the time difference for increasing tL and tH exists to avoid target device
Due to the error code of the non-ideal factors such as transmitted noise generation when decoding.In our implementation, when position data are 1, signal wire
Export low level time tL_HBFor 0.3 times of high level time tH_HB;When position data are 0, when signal wire output is low level
Between tL_LBFor 3 times of high level time tH_LB。
After completing previous consecutive frame and sending, source device can start the transmission of next consecutive frame, source device at any time
Also the high level that can control monobus output certain time, as the interval between frame and frame.
Source device is regular according to the data frame structure of above-mentioned protocol definition, data frame transfer sequence and data frame decoding,
Data frame is successively sent to target device from monobus.After target device receives data frame, duty ratio solution is carried out one by one
Code, is converted into parallel data after frame is transmitted, and can recover effective one or more number of bits evidences.
In step S103, target device is according to one or more of number of bits according to progress corresponding operation.
In step S104, when data communication system is in data-transmission mode and target device obtain one or
When multiple number of bits are according to being the first particular sequence code, S106 is entered step, target device enters control transmission mode;Otherwise,
S105 is entered step, target device maintains data-transmission mode.
Specifically, data-transmission mode is defaulted as after data communication system powers on.Under data-transmission mode, source device and
Target device carries out data transmission according to above-mentioned transport protocol.
In one embodiment, according to above-mentioned monobus transport protocol, source device is sent by monobus to target device
Following particular sequence code (particular sequence code is as shown in table 1), target device will enter control transmission mode;
Table 1
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | Operating mode |
1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | Into control transmission mode |
In step S106, target device is decoded received data frame in the case where controlling transmission mode one by one, obtains one
A or multiple number of bits evidences determine control frame head from one or more number of bits in, configure target according to control frame head
The control mode of equipment: directly controlling mode or indirectly controls mode.
Specifically, into after controlling transmission mode, monobus transport protocol is defined as:
The specific timing and data for controlling transmission mode are completely the same when transmitting;
It is regular to the coding and decoding of [D7D6D5D4D3D2D1D0] to have redefined target device,
[D7D6] is set as to control frame head, dibit.[if D7D6_D5D4D3D2D1D0] are as follows:
00_xxxxxx: directly controlling mode, and D5D4D3D2D1D0 is to directly control position, and user can make this 6 bits
Target device is written for specific control bit, realizes priority or the higher function control of important ratio;
01_xxxxxx/10_xxxxxx/11_xxxxxx: indirectly controlling mode, and D5D4D3D2D1D0 is specific operation
Code;In the particular embodiment, when frame head [D7D6] is respectively 01/10/11, it can define it and be combined with each other realization controlling behavior
Specific meaning.
In the present embodiment, as follows to behavior class definition under mode is indirectly controlled:
11_xxxxxx: operated register address (6bits) is set, and D5D4D3D2D1D0 is corresponded to specifically at this time
Location position;
10_xxxxxx: being written corresponding register data (6bits), and D5D4D3D2D1D0 is specific write-in number at this time
According to value;
01_xxxxxx: reading corresponding register data (6bits), and D5D4D3D2D1D0 is specific reading number at this time
According to value;In D5D4D3D2D1D0 and thereafter the period of EOD, target device will possess monobus control.
In step S107, when data communication system is in control transmission mode and target device obtains one or
When multiple number of bits are according to being the second particular sequence code, target device exits control transmission mode, enters step S105, and target is set
It is standby to enter data arq mode;Otherwise, S106 is entered step, target device maintains control transmission mode.
Specifically, in one embodiment, if in the case where controlling transmission mode, according to above-mentioned monobus transport protocol, source is set
It is standby to pass through monobus, following particular sequence code (particular sequence code is as shown in table 2) is sent to target device, target device will move out
Transmission mode is controlled, into data-transmission mode.
Table 2
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | Operating mode |
1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | Exit control transmission mode |
Specifically, below by drawings and examples, technical scheme of the present invention will be described in further detail.
In one embodiment of the present of invention, by source device, target device and the connection source device and target device
The data communication system that constitutes of monobus in, source device transmits data 0xA5 to target device, and it is aobvious to adjust Light-emitting diode LED
Show brightness, goal equipment is LED display module.
Specifically, steps are as follows: data frame is sent to by source device according to preset transport protocol, by monobus
Target device LED display module, wherein data frame is made of 8 bits;
Default source device and target device enter data-transmission mode after system electrification;
Under data-transmission mode, target device LED display module receives data frame, is decoded one by one, obtains 8 ratios
Special position data 10100101B;
Target device LED display module changes output size of current according to 10100101B according to 8 number of bits, to change it
Display brightness.
Another embodiment of the present invention, by source device, target device and the connection source device and target device
In the data communication system that monobus is constituted, under present data transmission mode, source device sends control information to target device,
Specific data write-in target device is specified register by source device.Such as register R11 (in source device setting target device
It includes step 1- step 4 that location, which is that 11) numerical value is the concrete operation step of 0x3C (6bits):
Specifically, step 1 is as shown in Figure 5: source device is according to preset transport protocol, by monobus by data frame
It is sent to target device, wherein data frame is made of 8 bits;
Default enters data-transmission mode, under data-transmission mode, target device logarithm after data communication system powers on
It is decoded one by one according to frame, obtains 8 number of bits according to 11110100B;
Target device judge 8 number of bits according to 11110100B for the first particular sequence code, target device enter control pass
Defeated mode;
Step 2 is as shown in Figure 6: in the case where controlling transmission mode, source device is according to preset transport protocol, by single total
Data frame is sent to target device by line, and wherein data frame is made of 8 bits;
In the case where controlling transmission mode, target device is decoded data frame one by one, obtains 8 number of bits according to 11B+
001011B;From 8 number of bits, D7D6 (11B) determines that control frame head is 11B in, is set according to control frame head 11B configuration target
Standby to be the mode that indirectly controls and be the address (6bits) that operated register is arranged, target device reads D5D4D3D2D1D0
For 001011B, the address that operated register is arranged is 11;
Step 3 is as shown in Figure 7: in the case where controlling transmission mode, source device is according to preset transport protocol, by single total
Data frame is sent to target device by line, and wherein data frame is made of 8 bits;
In the case where controlling transmission mode, target device is decoded data frame one by one, obtains 8 number of bits according to 10B+
111100B;From 8 number of bits, D7D6 (10B) determines that control frame head is 10B in, is set according to control frame head 10B configuration target
Standby to be the mode that indirectly controls and be the data (6bits) that corresponding register is written, target device reads D5D4D3D2D1D0
For 111100B, in register (address 11) operated by data (111100B) write step 2 by reading;
Step 4 is as shown in Figure 8: in the case where controlling transmission mode, source device is according to preset transport protocol, by single total
Data frame is sent to target device by line, and wherein data frame is made of 8 bits;
In the case where controlling transmission mode, target device is decoded data frame one by one, obtains 8 number of bits evidences
11111001B;
Target device judge 8 number of bits according to 11111001B for the second particular sequence code, target device exit control pass
Defeated mode, into data-transmission mode;
So far, source device, which is successfully obtained, sets 0x3C for the register R11 inside target device, completes control operation.
Another of the invention embodiment, by source device, target device and the connection source device and target device
In the data communication system that monobus is constituted, under present data transmission mode, source device sends control information to target device,
Source device reads the data in the specified register of target device.Such as (address is register R22 in source device reading target device
22) content, specific steps are as follows:
Step 1: data frame is sent to target device according to preset transport protocol, by monobus by source device,
Wherein data frame is made of 8 bits;
After system electrification default enter data-transmission mode, under data-transmission mode, target device to data frame one by one
It is decoded, obtains 8 number of bits according to 11110100B;
Target device judge 8 number of bits according to 11110100B for the first particular sequence code, target device enter control pass
Defeated mode;
Step 2: in the case where controlling transmission mode, source device is according to preset transport protocol, by monobus by data
Frame is sent to target device, and wherein data frame is made of 8 bits;
In the case where controlling transmission mode, target device is decoded data frame one by one, obtains 8 number of bits according to 11B+
010110B;From 8 number of bits, D7D6 (11B) determines that control frame head is 11B in, is set according to control frame head 11B configuration target
Standby to be the mode that indirectly controls and be the address (6bits) that operated register is arranged, target device is read
D5D4D3D2D1D0 is 010110B, and the address that operated register is arranged is 22;
Step 3: in the case where controlling transmission mode, source device is according to preset transport protocol, by monobus by data
Frame is sent to target device, and wherein data frame is made of 2 bits;
In the case where controlling transmission mode, target device is decoded data frame one by one, obtains 2 number of bits according to 01B;From
2 number of bits D7D6 (01B) in determines that control frame head is 01B, is control indirectly according to control frame head 01B configuration target device
Mode processed and the register data (6bits) corresponding for reading;
After source device has sent frame head D7D6 (01B), bus control right is discharged immediately, is in monobus and is not driven shape
State, monobus is pulled upward to high level by outside at this time;
Step 4: in the case where controlling transmission mode, after target device receives the sequence that frame head is 01B, first reading address is 22
Internal register contents, then obtain monobus control (detecting bus for height, non-driving condition), with a high position preceding,
The content of register is sent monobus (_ xxxxxxB) by the posterior sequence of low level.Target device is same after being sent completely
Also frame end position can be sent, transmits completed handshake as source device judges frame.Target device has sent frame end position
Afterwards, while bus control right will be discharged, monobus is made to be in non-driving condition (being pulled upward to high level by outside at this time);
Step 5: after source device has been properly received the sequence of target device transmission, detecting frame end position and current list
Bus is in non-driving condition, regains monobus control;
Step 6: in the case where controlling transmission mode, source device is according to preset transport protocol, by monobus by data
Frame is sent to target device, and wherein data frame is made of 8 bits;
In the case where controlling transmission mode, target device is decoded data frame one by one, obtains 8 number of bits evidences
11111001B;
Target device judge 8 number of bits according to 11111001B for the second particular sequence code, target device exit control pass
Defeated mode, into data-transmission mode;
So far, source device successfully has read the content of the internal register R22 of target device, completes control operation.
The embodiment of the present invention is by a kind of data communication method and its system, by data signal transmission and control signal transmission
It is achieved on monobus serial line interface.Technical solution based on the embodiment of the present invention, can be in general low and middle-end electronics
In product and corresponding integrated circuit, with lower hardware cost, less resource consumption, lesser software overhead, realize
Data transmission between each integrated circuit and module is particularly suitable for single-chip microcontroller as source device to the periphery as target device
Device transmission data and control signal.
Above-described specific embodiment has carried out further the purpose of the present invention, technical scheme and beneficial effects
It is described in detail, it should be understood that being not intended to limit the present invention the foregoing is merely a specific embodiment of the invention
Protection scope, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should all include
Within protection scope of the present invention.
Claims (8)
1. a kind of data communication method, applied to by source device, target device and the connection source device and target device
In the data communication system that monobus is constituted, it is characterised in that:
Data frame is sent to the target by the monobus and set by the source device according to preset transport protocol
Standby, the data frame is made of one or more bits;
The target device receives the data frame, is decoded one by one, obtains one or more of number of bits evidences;
The target device is according to one or more of number of bits according to progress corresponding operation;
When the data communication system is in data-transmission mode and the target device obtain it is one or more of
When number of bits is according to being the first particular sequence code, target device enters control transmission mode;
Wherein, after target device enters control transmission mode, target device is decoded received data frame one by one, obtains
One or more number of bits evidences determine control frame head from one or more of number of bits, according to the control frame in
Head configures the control mode of the target device;The control mode includes directly controlling mode and indirectly controlling mode;
When the data communication system be in control transmission mode when and the target device obtain it is one or more of
When number of bits is according to being the second particular sequence code, target device exits control transmission mode, into data-transmission mode.
2. data communication method according to claim 1, it is characterised in that: the data frame include start of frame bits, data bit,
Frame end position, wherein
The start of frame bits is the cycle time of one or more positions data;
The data bit includes one or more number of bits evidences, the data according to uimsbf unsigned integer most significant bit first, the posterior sequence of low level by
Position transmission or the data according to low level formerly, high-order posterior sequence transmits by turn;
The frame end position is the position that the first level changes to second electrical level and kept for the time of second electrical level be greater than 5 times
The cycle time of data;
The frame end position is used to indicate a data frame and completes transmission, and the target device can load and handle data.
3. data communication method according to claim 1, it is characterised in that: the source device is completed a data frame and sent
Afterwards, start the transmission of next data frame at any time;Or the source device controls the second of the monobus output certain time
Level, as the interval between the data frame.
4. data communication method according to claim 2, it is characterised in that: the decoding rule of the data frame are as follows: when one
When data bit high level lasting time tH and one data bit the low level duration tL meet relationship: tL > 2*tH, it is described
One data bit period signal designation one effective low-level data 0;As one data bit high level lasting time tH and
TH > 2*tL when one data bit the low level duration tL meets relationship, one data bit period signal designation one
A effective high level data 1.
5. data communication method according to claim 4, it is characterised in that: one data bit high level lasting time tH
It needs to meet with one data bit the low level duration tL:
TL < tL+tH < TH, wherein TH is first time threshold, and TL is second time threshold, and TH is greater than TL;
The first time threshold TH and second time threshold TL be conferred jointly by source device and target device it is preset
Numerical value, the first time threshold TH and second time threshold TL are as unit of system clock cycle, the second time threshold
TL is not less than 4 times of the system clock.
6. data communication method according to claim 4, it is characterised in that: message transmission rate depend on the source device or
The driving capability and data-handling capacity of target device described in person.
7. the data communication method according to Claims 2 or 3, it is characterised in that: the first level is low level, second electricity
It puts down as high level;Or first level is high level, the second electrical level is low level.
8. a kind of data communication system characterized by comprising source device, target device and the connection source device and mesh
The monobus of marking device, wherein
Source device, for data frame being sent to the target by the monobus and is set according to preset transport protocol
Standby, the data frame is made of one or more bits;
Target device is decoded one by one for receiving the data frame, obtains one or more of number of bits evidences;
The target device is according to one or more of number of bits according to progress corresponding operation;
When the data communication system is in data-transmission mode and the target device obtain it is one or more of
When number of bits is according to being the first particular sequence code, target device enters control transmission mode;
Wherein, after target device enters control transmission mode, target device is decoded received data frame one by one, obtains
One or more number of bits evidences determine control frame head from one or more of number of bits, according to the control frame in
Head configures the control mode of the target device;The control mode includes directly controlling mode and indirectly controlling mode;
When the data communication system be in control transmission mode when and the target device obtain it is one or more of
When number of bits is according to being the second particular sequence code, target device exits control transmission mode, into data-transmission mode.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510583365.6A CN105208021B (en) | 2015-09-14 | 2015-09-14 | A kind of data communication method and its system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510583365.6A CN105208021B (en) | 2015-09-14 | 2015-09-14 | A kind of data communication method and its system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105208021A CN105208021A (en) | 2015-12-30 |
CN105208021B true CN105208021B (en) | 2019-01-22 |
Family
ID=54955454
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510583365.6A Active CN105208021B (en) | 2015-09-14 | 2015-09-14 | A kind of data communication method and its system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105208021B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108011692A (en) * | 2017-06-30 | 2018-05-08 | 宁波方太厨具有限公司 | A kind of data communications method for microcontroller |
CN108429612A (en) * | 2018-03-01 | 2018-08-21 | 航天柏克(广东)科技有限公司 | A kind of semiduplex means of communication of single line |
CN111739276B (en) * | 2020-07-02 | 2021-08-31 | 上海赞芯电子科技有限公司 | Communication protocol and communication method for electronic fuse |
CN112672253B (en) * | 2020-12-09 | 2022-06-21 | 瑞芯微电子股份有限公司 | PCM data modulation method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101984486A (en) * | 2010-10-25 | 2011-03-09 | 深圳市明微电子股份有限公司 | Transmission method capable of setting instructions and transmission device |
CN102033833A (en) * | 2009-09-25 | 2011-04-27 | 研祥智能科技股份有限公司 | Serial port communication switching method and serial port communication system |
CN104679704A (en) * | 2013-12-02 | 2015-06-03 | 林南 | Single bus communication system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100462177B1 (en) * | 2002-08-26 | 2004-12-17 | 삼성전자주식회사 | Embedded controller capable of backing up operating states of a peripheral device in the real time |
-
2015
- 2015-09-14 CN CN201510583365.6A patent/CN105208021B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102033833A (en) * | 2009-09-25 | 2011-04-27 | 研祥智能科技股份有限公司 | Serial port communication switching method and serial port communication system |
CN101984486A (en) * | 2010-10-25 | 2011-03-09 | 深圳市明微电子股份有限公司 | Transmission method capable of setting instructions and transmission device |
CN104679704A (en) * | 2013-12-02 | 2015-06-03 | 林南 | Single bus communication system |
Also Published As
Publication number | Publication date |
---|---|
CN105208021A (en) | 2015-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105208021B (en) | A kind of data communication method and its system | |
JP6325537B2 (en) | N-phase polarity output pin mode multiplexer | |
JP6878300B2 (en) | Improved virtual GPIO with multi-mode modulation | |
WO2016140765A2 (en) | Packet format and coding method for serial data transmission | |
CN113626360B (en) | Low-speed MIPI observation type SOC chip and operation method thereof | |
US20190266122A1 (en) | Multilane heterogenuous serial bus | |
US10331610B2 (en) | UART with automated protocols | |
CN103095703B (en) | A kind of method, equipment and system realizing network and serial port data interactive | |
US9524265B2 (en) | Providing a serial protocol for a bidirectional serial interconnect | |
US10139875B2 (en) | Farewell reset and restart method for coexistence of legacy and next generation devices over a shared multi-mode bus | |
KR20170126904A (en) | Farewell reset and restart method for coexistence of legacy and next generation devices over a shared multi-mode bus | |
CN109828943B (en) | Processing system and method for improving serial port transmission rate of low-rate communication network | |
CN104104412A (en) | Direct memory access (DMA) based power line network system and communication method thereof | |
CN101551787B (en) | Communication method for self-adaptive data transfer in master-slave communication | |
US20160371157A1 (en) | Serial interface with bit-level acknowledgement and error correction | |
CN110471882A (en) | A kind of monobus telecommunication circuit and method | |
CN111884987B (en) | Electronic device and method for electronic device | |
CN110365710A (en) | Multi-protocols aggregation transfer device, system and method | |
CN210270888U (en) | Single-bus communication circuit | |
Foster | Xbee cookbook issue 1.4 for series 1 (freescale) with 802.15. 4 firmware | |
CN108184100A (en) | A kind of multipoint wireless Video transmission system | |
CN210405365U (en) | Multi-protocol aggregation transmission device and system | |
CN106911480A (en) | A kind of network interface card and its method for designing | |
CN103200210B (en) | Digital quantity input equipment and method based on High-Level Data Link Control | |
CN201726410U (en) | Jacquard pattern data transmission 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210421 Address after: No.1, floor 4, building 10, No.303, group 3, liangfengding village, Zhengxing Town, Tianfu New District, Chengdu, Sichuan 610000 Patentee after: Sichuan Yichong Technology Co.,Ltd. Address before: 300457, Tianjin Binhai New Area, Tianjin Development Zone, No. 19 West Ring Road, TEDA service outsourcing Garden No. 2701-1 building, room 2 Patentee before: INTERNATIONAL GREEN CHIP (TIANJIN) Co.,Ltd. |
|
TR01 | Transfer of patent right |