CN110415504A - Single-wire UART communication method, computer readable storage medium and household appliance - Google Patents
Single-wire UART communication method, computer readable storage medium and household appliance Download PDFInfo
- Publication number
- CN110415504A CN110415504A CN201910670370.9A CN201910670370A CN110415504A CN 110415504 A CN110415504 A CN 110415504A CN 201910670370 A CN201910670370 A CN 201910670370A CN 110415504 A CN110415504 A CN 110415504A
- Authority
- CN
- China
- Prior art keywords
- uart
- main control
- communication
- control mcu
- wireless communication
- 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.)
- Pending
Links
- 238000004891 communication Methods 0.000 title claims abstract description 153
- 238000000034 method Methods 0.000 title claims abstract description 7
- 238000004590 computer program Methods 0.000 claims description 10
- 230000005540 biological transmission Effects 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 3
- 230000001360 synchronised effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000004378 air conditioning Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G08—SIGNALLING
- G08C—TRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
- G08C17/00—Arrangements for transmitting signals characterised by the use of a wireless electrical link
- G08C17/02—Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Small-Scale Networks (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a single-wire UART communication method, a computer readable storage medium and a household appliance, wherein the single-wire UART communication method realizes the communication between a main control MCU and two groups of different communication devices, and realizes the communication between the two different communication devices by utilizing a group of UART chip resources through exchanging a UART communication pin receiving port and a UART communication pin transmitting port of the main control MCU and exchanging the UART communication pin receiving port and the UART communication pin transmitting port of the two groups of different communication devices, thereby effectively improving the utilization rate of the chip resources, reducing the product cost and further improving the market competitiveness of products.
Description
Technical field
The present invention relates to fields of communication technology, and in particular to a kind of single line UART means of communication, computer-readable storage medium
Matter and household electrical appliance.
Background technique
Being constantly progressive with internet of things technology at this stage, it is imperative that household electrical appliance increase internet of things technology.Also have more at present
The various controls means such as wifi, bluetooth and line traffic control are increased come more household electrical appliance, are supplied to the diversified control of client
Means processed can manipulate the household electrical appliance such as air-conditioning.With the diversification of control means, communication interface is also more and more, for household
The communication resources of the main MCU of electric appliance also proposed higher demand, and chip increases UART resource newly and often means that chip cost
Increase, product cost is caused to increase and lose product competitiveness.
Summary of the invention
In view of the deficiencies of the prior art, the present invention realizes the communication to two kinds of equipment, section using one group of UART port of chip
About cost.
To achieve the above object, the present invention adopts the following technical scheme:
A kind of single line UART means of communication are completed using one group of UART communication resources of main control MCU to two kinds of different communication equipments
Communication, specifically the same pin of UART communication resources can both do receiving port or do transmission mouth, but same group of UART
A pin configuration at receiving port then another pin configuration at send mouth.
Further, wireless communication module A is established by the first UART chip and main control MCU and is communicated, and main control MCU passes through the
Two UART chips and wireless communication module B, which are established, to be communicated.
Further, the UART communication pin configuration of wireless communication module A is to send mouth, the UART of wireless communication module B
Communication pin configuration is receiving port, and the UART pin 1 of main control MCU is configured to receiving port, and the UART pin 2 of main control MCU is configured to
Send mouth.
Further, wireless communication module A sends the first bag data to main control MCU and establishes communication, and synchronous main control MCU is sent
First bag data is to wireless communication module B and establishes communication.
Further, main control MCU receives the first bag data of wireless communication module A, and wireless communication module B receives master
After controlling the first bag data of MCU, the pin configuration of UART chip is changed are as follows: the UART of wireless communication module A communicates pin configuration and is
The UART communication pin configuration of receiving port, wireless communication module B is to send mouth, and the UART pin 1 of main control MCU is configured to send
Mouthful, the UART pin 2 of main control MCU is configured to receiving port.
Further, wireless communication module B sends the second bag data to main control MCU, and main control MCU is to wireless communication module A
The second bag data is sent, data response is carried out.
Further, the data packet between wireless communication module A and main control MCU is transmitted according to baud rate and long data packet
Degree calculates bag data communication duration, to this time timing and judges whether data packet is sent completely using program.
Further, the data packet between wireless communication module B and main control MCU is transmitted according to baud rate and long data packet
Degree calculates bag data communication duration, to this time timing and judges whether data packet is sent completely using program.
Further, according to the longest communication time of wireless communication module A and main control MCU packet communication duration, and
The longest communication time of wireless communication module B and main control MCU packet communication duration receive sending function to switch pin.
A kind of computer readable storage medium, for storing computer program, the computer program is called by processor
The single line UART means of communication of Shi Shixian or more.
A kind of household electrical appliance, including processor and memory, the memory is for storing computer program, the calculating
The single line UART means of communication more than being realized when machine program is called by the processor.
A kind of single line UART means of communication provided by the invention, the beneficial effect of computer readable storage medium and household electrical appliance
Fruit is: realizing in the case where the UART chip resource of main control MCU is inadequate, not using one group of two kinds of UART chip resource realization
With the communication between equipment, while low-cost chip can be used to realize product function, reduce product cost and then mention
The high market competitiveness.
Detailed description of the invention
Fig. 1 is present system block diagram representation;
Fig. 2 is the flow diagram of the embodiment of the present invention 1;
Fig. 3 is the flow diagram of the embodiment of the present invention 2.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Whole description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Ability
Domain ordinary person every other embodiment obtained without making creative work, belongs to protection of the invention
Range.
A kind of embodiment 1: full duplex single line UART means of communication.
A kind of full duplex single line UART means of communication are completed to two kinds not using one group of UART communication resources of main control MCU
With the communication of communication apparatus, the specifically same pin of UART communication resources can both do receiving port or do transmission mouth, but
At receiving port, then another pin configuration is at mouth is sent for a pin configuration of same group of UART, as shown in Fig. 2, the communication side
Method can carry out the transmitted in both directions of communication signal simultaneously, i.e. transmission between wireless communication module A and wireless communication module B can be with
It is temporal synchronization, specifically includes the following steps:
S1 is powered on, and after level equalization, chip bottom is configured that the UART communication pin configuration of wireless communication module A to send
Mouthful, the UART communication pin configuration of wireless communication module B is receiving port, and the UART pin 1 of main control MCU is configured to receiving port,
UART pin 2 is configured to send mouth;
S2, wireless communication module A start to send the first bag data to main control MCU and establish communication, and synchronous main control MCU sends first
Bag data is to wireless communication module B and establishes communication;
After S3, main control MCU receive wireless communication module A data packet, and wireless communication module B receives main control MCU data packet
(both sides can calculate bag data communication duration, program can be to this time timing simultaneously according to baud rate and data packet length herein
Judge whether data packet is sent completely), data to be sent, chip bottom configuration change are as follows: nothing are handled according to both sides' communications protocol
The UART communication pin configuration of line communication module A is receiving port, and the UART communication pin configuration of wireless communication module B is to send
Mouthful, the UART pin 1 of main control MCU is configured to send mouth, and UART pin 2 is configured to receiving port;
S4, main control MCU send data packet to wireless communication module A, and wireless communication module B sends data packet to main control MCU, carry out
Data response;
S5, main control MCU and wireless communication module A handle the data packet received, and turn to step S1 as above, carry out communication and follow
Ring.
The means of communication of embodiment 1 are applied under the conditions of main control MCU support full duplex communication, arrow a, b, c, d in Fig. 1
Indicate data transfer flow direction, the TXD in Fig. 2 and Fig. 3 indicates to send mouth, and RXD indicates receiving port.
A kind of embodiment 2: half-duplex single line UART means of communication.
A kind of half-duplex single line UART means of communication are completed to two kinds not using one group of UART communication resources of main control MCU
With the communication of communication apparatus, the specifically same pin of UART communication resources can both do receiving port or do transmission mouth, but
At receiving port, then another pin configuration is at mouth is sent for a pin configuration of same group of UART, as shown in figure 3, the communication side
Wireless communication module A and wireless communication module B can carry out the transmission of both direction in method, but be unable to simultaneous transmission, same
Time wireless communication module A and wireless communication module B can only one-way communication, specifically includes the following steps:
S1 is powered on, and after level equalization, chip bottom is configured that the UART communication pin configuration of wireless communication module A to send
Mouthful, the UART communication pin configuration of wireless communication module B is receiving port, and the UART pin 1 of main control MCU is configured to receiving port,
UART pin 2 is configured to send mouth;
S2, wireless communication module A start to send the first bag data to main control MCU and establish communication, and main control MCU is detecting wirelessly
After communication module A data packet is sent completely, data are sent to wireless communication module B, data packet enters in next step after being sent completely;
S3 handles data to be sent, chip bottom configuration change are as follows: the UART of wireless communication module A according to both sides' communications protocol
Communication pin configuration is receiving port, and the UART communication pin configuration of wireless communication module B is to send mouth, and the UART of main control MCU draws
Foot 1 is configured to send mouth, and UART pin 2 is configured to receiving port;
S4, wireless communication module B reply data to main control MCU, after main control MCU detection data packet is sent completely, to wireless telecommunications
Modules A replys data, carries out data recovery;
S5, main control MCU and wireless communication module A handle the data packet received, and turn to step S1 as above, carry out communication and follow
Ring.
The means of communication of embodiment 2 are applied to main control MCU and only support half-duplex rather than in the case where full duplex.
A kind of embodiment 3: computer readable storage medium.
A kind of computer readable storage medium, for storing computer program, the computer program is called by processor
The single line UART means of communication of Shi Shixian embodiment 1 or embodiment 2.
A kind of embodiment 4: household electrical appliance.
A kind of household electrical appliance, including processor and memory, the memory is for storing computer program, the calculating
The single line UART means of communication of embodiment 1 or embodiment 2 are realized when machine program is called by the processor.
The above is presently preferred embodiments of the present invention, but the present invention should not be limited to embodiment and attached drawing institute public affairs
The content opened both falls within protection of the present invention so all do not depart from the lower equivalent or modification completed of spirit disclosed in this invention
Range.
Claims (10)
1. a kind of single line UART means of communication, which is characterized in that using one group of UART communication resources of main control MCU, complete to two
The communication of kind different communication equipment, the specifically same pin of UART communication resources can both do receiving port or send
Mouthful, but a pin configuration of same group of UART at receiving port then another pin configuration at send mouth.
2. the single line UART means of communication as described in claim 1, which is characterized in that wireless communication module A passes through the first UART
Chip and main control MCU, which are established, to be communicated, and main control MCU is established by the second UART chip and wireless communication module B and communicated.
3. the single line UART means of communication as claimed in claim 2, it is characterised in that: the UART communication of wireless communication module A is drawn
Foot is configured to send mouth, and the UART communication pin configuration of wireless communication module B is receiving port, and the UART pin 1 of main control MCU configures
For receiving port, the UART pin 2 of main control MCU is configured to send mouth.
4. the single line UART means of communication as claimed in claim 3, it is characterised in that: wireless communication module A is sent to main control MCU
First bag data establishes communication, and synchronous main control MCU sends the first bag data and to wireless communication module B and establishes communication.
5. the single line UART means of communication as claimed in claim 4, it is characterised in that: main control MCU receives wireless communication module A
First bag data, and after wireless communication module B receives the first bag data of main control MCU, the pin configuration of UART chip is changed are as follows:
The UART communication pin configuration of wireless communication module A is receiving port, and the UART communication pin configuration of wireless communication module B is to send
Mouthful, the UART pin 1 of main control MCU is configured to send mouth, and the UART pin 2 of main control MCU is configured to receiving port.
6. the single line UART means of communication as claimed in claim 5, it is characterised in that: wireless communication module B is sent to main control MCU
Second bag data, main control MCU send the second bag data to wireless communication module A, carry out data response.
7. the single line UART means of communication as claimed in claim 6, it is characterised in that: wireless communication module A and main control MCU it
Between data packet transmission according to baud rate and data packet length, bag data communication duration is calculated, using program to this time
Timing simultaneously judges whether data packet is sent completely.
8. the single line UART means of communication as claimed in claim 6, it is characterised in that: wireless communication module B and main control MCU it
Between data packet transmission according to baud rate and data packet length, bag data communication duration is calculated, using program to this time
Timing simultaneously judges whether data packet is sent completely.
9. a kind of computer readable storage medium, for storing computer program, it is characterised in that: the computer program is located
It manages when device calls and realizes the described in any item single line UART means of communication of claim 1 to 8.
10. a kind of household electrical appliance, including processor and memory, for storing computer program, feature exists the memory
In: the communication side claim 1 to 8 described in any item single line UART is realized when the computer program is called by the processor
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910670370.9A CN110415504A (en) | 2019-07-24 | 2019-07-24 | Single-wire UART communication method, computer readable storage medium and household appliance |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910670370.9A CN110415504A (en) | 2019-07-24 | 2019-07-24 | Single-wire UART communication method, computer readable storage medium and household appliance |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110415504A true CN110415504A (en) | 2019-11-05 |
Family
ID=68362773
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910670370.9A Pending CN110415504A (en) | 2019-07-24 | 2019-07-24 | Single-wire UART communication method, computer readable storage medium and household appliance |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110415504A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1932128A (en) * | 2005-09-13 | 2007-03-21 | 深圳市拓邦电子科技股份有限公司 | Double-control single-wire communication washing machine control system |
CN103605627A (en) * | 2013-12-04 | 2014-02-26 | 福建师范大学 | One-wire full-duplex bus |
CN106383801A (en) * | 2016-09-29 | 2017-02-08 | 浙江方大智控科技有限公司 | Single line type UART communication circuit |
-
2019
- 2019-07-24 CN CN201910670370.9A patent/CN110415504A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1932128A (en) * | 2005-09-13 | 2007-03-21 | 深圳市拓邦电子科技股份有限公司 | Double-control single-wire communication washing machine control system |
CN103605627A (en) * | 2013-12-04 | 2014-02-26 | 福建师范大学 | One-wire full-duplex bus |
CN106383801A (en) * | 2016-09-29 | 2017-02-08 | 浙江方大智控科技有限公司 | Single line type UART communication circuit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108668381B (en) | Communication means and device | |
CN1981495B (en) | Method and apparatus for isochronous datagram delivery over contention-based data link | |
CN101136828B (en) | RS485 based multi-host machine wired serial communication method | |
CN104317765B (en) | A kind of one-to-many communication system and implementation method based on serial communication | |
CN101982944B (en) | Method for underwater acoustic sensor network Aloha protocol | |
CN103200116B (en) | The reliable UDP transmission agreement that not face connects and data transmission method | |
CN102098113B (en) | Method for realizing water sound sensor network MAC (Media Access Control) protocol based on ALOHA and TDMA (Time Division Multiple Access) | |
CN105657571B (en) | A kind of method that transmission of video saves bandwidth in local area network | |
CN108323241A (en) | Principal and subordinate's role transforming method, chip and data transmission system | |
CN110557328A (en) | Heterogeneous multimode intelligent gateway equipment and method applied to unmanned aerial vehicle scene | |
CN109392028A (en) | The method and equipment of data transmission | |
CN109120524A (en) | Link aggregation method and relevant device | |
CN103338184B (en) | Data transmitting method and data transmitting apparatus | |
CN107735985A (en) | Electronic installation, its wireless communications method and non-transitory computer-readable storage media | |
CN105450969B (en) | A kind of real time video data transmission method and electronic equipment | |
CN106488499A (en) | A kind of service shunting method and device | |
CN103560970A (en) | Method for realizing downlink speed limitation of network device with multiple LAN ports | |
CN110415504A (en) | Single-wire UART communication method, computer readable storage medium and household appliance | |
CN106535286A (en) | TDMA-based sea-surface wireless communication networking method | |
CN105764091A (en) | Method of effectively utilizing wireless bandwidth | |
CN104486187B (en) | A kind of CAN communication device and method of dynamic synchronization | |
CN102624769A (en) | Pipeline network device and related data transmission method | |
CN110012506A (en) | A kind of data transmission method and communication equipment | |
CN201639783U (en) | Multi-point cooperative transceiver system and multi-point cooperative transceiver control equipment | |
CN202197299U (en) | Household Internet of Things gateway |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191105 |