CN102447599A - Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine) - Google Patents

Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine) Download PDF

Info

Publication number
CN102447599A
CN102447599A CN2011103845222A CN201110384522A CN102447599A CN 102447599 A CN102447599 A CN 102447599A CN 2011103845222 A CN2011103845222 A CN 2011103845222A CN 201110384522 A CN201110384522 A CN 201110384522A CN 102447599 A CN102447599 A CN 102447599A
Authority
CN
China
Prior art keywords
module
slave
data
main frame
fsm
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
Application number
CN2011103845222A
Other languages
Chinese (zh)
Inventor
苏成悦
李文杰
庄伟林
周泰毅
陈旭峰
叶政熙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN2011103845222A priority Critical patent/CN102447599A/en
Publication of CN102447599A publication Critical patent/CN102447599A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a control system and a control method for a short-distance home communication protocol based on an FSM (Finite State Machine). In a short-distance home communication system, nodes of a host machine and various slave machines are connected in parallel onto a same data bus, in order to avoid conflict of the data bus, the communication is agreed to be initiated by the host machine, and all of the slave machines are in a receiving state at any time; and moreover, the slave machines make responses only after the slave machines receive the address codes matched with the addresses of the slave machines; and meanwhile, the slave machines cannot be communicated mutually. The communication protocol can realize unification of communication standards between control modules of household electrical appliances, so that the automation control of the household electrical appliances can be realized safely.

Description

Control system and control method based on the short distance household communications protocol of FSM
Technical field
The present invention relates to the finite state machine technical field, particularly a kind of control system and control method of the short distance household communications protocol based on FSM.
Background technology
The electrical appliance number of nodes increases sharply in the rapid raising of Along with people's living standard, household, and people are also increasingly high to the intelligent control degree requirement of electrical appliance in the household.Yet,, thereby cause problems such as the communications protocol between each control module of electrical appliance is diversified in the household, the communication interface program is numerous and diverse because the communication between each control module of electrical appliance does not have unified standard in the household.
Summary of the invention
Technical problem to be solved by this invention provides a kind of control system and control method of the short distance household communications protocol based on FSM; The present invention combine each appliance chamber communication distance in the modern house short and one main many from characteristics; Utilize the basic thought of finite state machine, thereby realize the purpose of the communication between each monitoring module of management and main control module.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is: a kind of control system of the short distance household communications protocol based on FSM comprises main frame and the some slaves that are connected with main frame; Said main frame comprises transmission cache module, insert module, transmitter register module and the CRC generator module that connects successively; Said slave comprises receiving register module, detection module, reception cache module and the CRC detector module that connects successively; The signal output part of said CRC generator module is connected with the signal input part of receiving register module simultaneously.
Preferably, said main frame is connected with some slaves through same data/address bus.
Preferably, said main frame also comprises the parallel/serial modular converter of FIFO; The signal input part of the parallel/serial modular converter of said FIFO is connected with the signal output part of transmitter register module simultaneously; The signal output part of the parallel/serial modular converter of said FIFO is connected with the signal input part of receiving register module simultaneously.
Preferably, said slave also comprises the serial/parallel modular converter of reception FIFO, and the signal input part of the serial/parallel modular converter of said reception FIFO is connected with the signal output part that receives cache module simultaneously.
A kind of control method of the short distance household communications protocol based on FSM, said main frame is initiated Frame through the transmission cache module, insert module, transmitter register module and the CRC generator module that connect successively to slave; Said slave receives data through the receiving register module, and detection module detects the data that receive; Through detecting, if do not receive the geocoding with self matching addresses, then this slave still is in accepting state; If said slave receives the geocoding with self matching addresses, then its reception cache module begins receiving data frames and transmits said Frame, and after waiting to finish receiving, the CRC detector module is carried out the CRC check to this Frame; If data are made mistakes, then this slave requires the main frame retransmission data, and data are correctly then carried out handled to data.
Preferably, the composition of said Frame comprises flag bit 01111110B, is public address, function code, the check bit of public address with 00000000H.
Preferably, said main frame at first sends data start flag; Then send the address of slave addresses and main frame; Send the function code that two-shipper is arranged then in agreement; And then be exactly data division; Send the CRC test value at last.
Preferably, said CRC check adopts 16 CRCs to carry out error check; Said error checking and correction refers to the content of whole Frame is done the CRC CRC; Promptly the error code in the error correction scope is corrected; Error code in the error check scope is carried out verification, but can not correct.
Preferably, said main frame carries out communication through single main list from pattern and some slaves.
Preferably, said main frame carries out communication through broadcast mode and some slaves.
The present invention is with respect to prior art; Has following beneficial effect: the control system and the control method that the present invention is based on the short distance household communications protocol of FSM; This communications protocol can realize the unification of the communication standard between the household electrical appliance control module, thereby realizes the automation control of each household electrical appliance safely.
Description of drawings
Fig. 1 is the system block diagram of control system that the present invention is based on the short distance household communications protocol of FSM;
Fig. 2 is the flow chart of control method that the present invention is based on the short distance household communications protocol of FSM;
Fig. 3 is the fundamental diagram of control method that the present invention is based on the short distance household communications protocol of FSM.
Embodiment
Below in conjunction with embodiment and accompanying drawing the present invention is described in further detail, but execution mode of the present invention is not limited thereto.
As shown in Figure 1, a kind of control system of the short distance household communications protocol based on FSM comprises main frame and the some slaves that are connected with main frame.This main frame is connected with some slaves through same data/address bus 1.
This main frame comprises transmission cache module 17, insert module 16, the transmitter register module 14 that connects successively.This main frame also comprises the parallel/serial modular converter of FIFO 11, CRC generator module 13; And the signal input part of the parallel/serial modular converter of FIFO 11, CRC generator module 13 is connected with the signal output part of transmitter register module 14 simultaneously.In the drawings, the parallel/serial modular converter 11 of this FIFO sends data through TXD packet 10, and CRC generator module 13 is sent data through TXC packet 12.Insert module 16 is used to insert data start flag and target slave addresses and this machine address.
This slave comprises receiving register module 3, detection module 5, the reception cache module 6 that connects successively.Slave also comprises CRC detector module 7, receives the serial/parallel modular converter 8 of FIFO; The signal input part of this CRC detector module 7, the serial/parallel modular converter 8 of reception FIFO is connected with the signal output part that receives cache module 6 simultaneously.And receiving register module 3 receives corresponding data through RXD packet, RXC packet respectively; And the signal output part of the parallel/serial modular converter of FIFO 11, CRC generator module 13 is connected with the signal input part of receiving register module 14 simultaneously.Detection module 5 is used for the data start bit and detects and slave addresses.
Preferably, this main frame carries out communication through single main list from pattern and some slaves.Single main single from pattern: under this pattern, main frame carries out communication through geocoding and the slave that uses slave.When data/address bus was idle, every slave all was in accepting state.When main frame was initiated communication, every slave all compared the geocoding that receives and self address, mated successful slave and sent answer signal, and other slave continues to get into accepting state.
Preferably, said main frame carries out communication through broadcast mode and some slaves.Broadcast mode: under this pattern, main frame uses the public address of agreement to carry out the transmission of data, and all slaves are handled receiving the data that all will receive subsequently behind this special address, but can not reply.This pattern is suitable for the command transfer that some special circumstances does not have return data.
The operation principle of this control system is following: in a short-range household communication system; The node of main frame and each slave is attempted by on same the data/address bus; Clash for fear of data/address bus, the agreement communication can only be initiated by main frame, and any moment of slave all is in accepting state; And only behind the geocoding that receives when slave with self matching addresses, just can respond; Can not carry out communication between the slave simultaneously.
Particularly, main frame is initiated Frame with CRC generator module 13 to slave through the transmission cache module 17, insert module 16, the transmitter register module 14 that connect successively.Slave receives data through receiving register module 3, and detection module 5 detects the data that receive; Through detecting, if do not receive the geocoding with self matching addresses, then this slave still is in accepting state; If slave receives the geocoding with self matching addresses, then it receives cache module 6 beginning receiving data frames and transmits said Frame, and after waiting to finish receiving, 7 pairs of these Frames of CRC detector module carry out the CRC check; If data are made mistakes, then this slave requires the main frame retransmission data, and data are correctly then carried out handled to data.Wherein, Frame comprises flag bit 01111110B, is public address, function code, the check bit of public address with 00000000H.Main frame at first sends data start flag; Then send the address of slave addresses and main frame; Send the function code that two-shipper is arranged then in agreement; And then be exactly data division; Send the CRC test value at last.The slave initial condition is in the IDLE24 state, and this slave constantly detects the data on the data bus, and when this slave was in the R_Addr034 state, this slave received data.The CRC check adopts 16 CRCs to carry out error check, and its generator polynomial is x16+x12+x5+1.And error checking and correction refers to the content of whole Frame is done the CRC CRC; Promptly the error code in the error correction scope is corrected; Error code in the error check scope is carried out verification, but can not correct.
As shown in Figure 2, be the flow chart of the control method of the short distance household communications protocol that the present invention is based on FSM.In the transmitting-receiving process of data; At first main frame sends data start flag 01111110B; Then sending the address of slave addresses, public address (00000000H) and main frame, send the function code that two-shipper is arranged then in agreement, is real data division with that; Be the CRC test value then, wait for the slave response at last.
As shown in Figure 3, be the schematic diagram of the Data Receiving of the control method of the short distance household communications protocol that the present invention is based on FSM.Generally speaking, slave is in IDLE state (24), constantly the data on the data bus is detected; In case the data Recive_Byte==Start_Byte25 that serial ports receives (start byte 01111110B) thinks that just frame data transmission begins, slave gets into Receive_Frame_Start_byte state 26; Otherwise coupling is made mistakes, and still is in IDLE state 24.
When slave is in Receive_Frame_Start_byte state (26), if the data Recive_Byte==ADDR that serial ports receives [31:24] 27 (the 3rd byte of the address of slave own), then slave gets into R_Addr3 state 28; Otherwise coupling is made mistakes, and gets into IDLE state 24.
When slave is in R_Addr3 state 28, if the data Recive_Byte==ADDR that serial ports receives [23:16] 29 (second byte of the address of receiver own), then slave gets into R_Addr2 state 30; Otherwise coupling is made mistakes, and gets into IDLE state 24.
When slave is in R_Addr2 state 30, if the data Recive_Byte==ADDR that serial ports receives [14:8] 31 (first byte of the address of receiver own), then slave gets into R_Addr1 state 32; Otherwise coupling is made mistakes, and gets into IDLE state 24.
When slave is in R_Addr1 state 32, if the data Recive_Byte==ADDR that serial ports receives [7:0] 33 (the 0th byte of the address of receiver own), then state machine gets into R_Addr0 state 34; Otherwise coupling is made mistakes, and gets into IDLE state 24.
When slave is in R_Addr0 state 34, show that slave has received the start byte and receiver 32 bit address of sending packet now, the receiver address of packet and the matching addresses of slave show that this packet sends to this slave.Therefore, the Data Receiving chance of ensuing 12 bytes receives continuously, deposits in the buffer memory, receive 12 bytes after, state machine gets into IDLE state 24, continues detecting data.
After the Data Receiving of a frame was accomplished, slave at first carried out the CRC check to data, made mistakes if find data, and the host address that has then just sended over according to main frame is got in touch with, and requires the main frame retransmission data.When data detection was correct, slave just can be judged the data that main frame sends over according to the data code of arranging in the agreement, and carries out corresponding data processing; Send data if desired back to, then slave must be accomplished in the time of agreement.
The foregoing description is merely preferred embodiment of the present invention, is not to be used for limiting practical range of the present invention.Be that all equalizations of doing according to content of the present invention change and modification, all contained by claim of the present invention scope required for protection.

Claims (10)

1. the control system based on the short distance household communications protocol of FSM comprises main frame and the some slaves that are connected with main frame; It is characterized in that: said main frame comprises transmission cache module (17), insert module (16), the transmitter register module (14) and CRC generator module (13) that connects successively; Said slave comprises receiving register module (3), detection module (5), the reception cache module (6) and CRC detector module (7) that connects successively; The signal output part of said CRC generator module (13) is connected with the signal input part of receiving register module (14) simultaneously.
2. the control system of the short distance household communications protocol based on FSM according to claim 1 is characterized in that: said main frame is connected with some slaves through same data/address bus (1).
3. the control system of the short distance household communications protocol based on FSM according to claim 1, it is characterized in that: said main frame also comprises the parallel/serial modular converter of FIFO (11); The signal input part of the parallel/serial modular converter of said FIFO (11) is connected with the signal output part of transmitter register module (14) simultaneously; The signal output part of the parallel/serial modular converter of said FIFO (11) is connected with the signal input part of receiving register module (14) simultaneously.
4. the control system of the short distance household communications protocol based on FSM according to claim 1; It is characterized in that: said slave also comprises the reception serial/parallel modular converter of FIFO (8), and the signal input part of the said reception serial/parallel modular converter of FIFO (8) is connected with the signal output part that receives cache module (6) simultaneously.
5. control method like the described short distance household communications protocol based on FSM of claim 1-4, it is characterized in that: said main frame is initiated Frame with CRC generator module (13) to slave through the transmission cache module (17), insert module (16), the transmitter register module (14) that connect successively; Said slave receives data through receiving register module (3), and detection module (5) detects the data that receive; Through detecting, if do not receive the geocoding with self matching addresses, then this slave still is in accepting state; If said slave receives the geocoding with self matching addresses; Then it receives cache module (6) beginning receiving data frames and transmits said Frame; After waiting to finish receiving, CRC detector module (7) is carried out the CRC check to this Frame; If data are made mistakes, then this slave requires the main frame retransmission data, and data are correctly then carried out handled to data.
6. the control method of the short distance household communications protocol based on FSM according to claim 5, it is characterized in that: said Frame comprises flag bit 01111110B, is public address, function code, the check bit of public address with 00000000H.
7. the control method of the short distance household communications protocol based on FSM according to claim 5, it is characterized in that: said main frame at first sends data start flag; Then send the address of slave addresses and main frame; Send the function code that two-shipper is arranged then in agreement; And then be exactly data division; Send the CRC test value at last.
8. the control method of the short distance household communications protocol based on FSM according to claim 5 is characterized in that: said CRC check adopts 16 CRCs to carry out error check; Said error checking and correction refers to the content of whole Frame is done the CRC CRC; Promptly the error code in the error correction scope is corrected; Error code in the error check scope is carried out verification, but can not correct.
9. according to the control system of each described short distance household communications protocol based on FSM of claim 5-8, it is characterized in that: said main frame mainly singly carries out communication from pattern and some slaves through single.
10. according to the control system of each described short distance household communications protocol based on FSM of claim 5-8, it is characterized in that: said main frame carries out communication through broadcast mode and some slaves.
CN2011103845222A 2011-11-28 2011-11-28 Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine) Pending CN102447599A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011103845222A CN102447599A (en) 2011-11-28 2011-11-28 Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011103845222A CN102447599A (en) 2011-11-28 2011-11-28 Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine)

Publications (1)

Publication Number Publication Date
CN102447599A true CN102447599A (en) 2012-05-09

Family

ID=46009706

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011103845222A Pending CN102447599A (en) 2011-11-28 2011-11-28 Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine)

Country Status (1)

Country Link
CN (1) CN102447599A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108093492A (en) * 2017-12-26 2018-05-29 上海创程车联网络科技有限公司 A kind of wireless radio frequency modules serial communication method for remote control equipment
CN109951256A (en) * 2019-03-28 2019-06-28 常州索维尔电子科技有限公司 On-board high-voltage power supply integrating device and its communication means and the new-energy automobile high voltage power supply for applying it
CN112289017A (en) * 2020-10-28 2021-01-29 国网安徽省电力有限公司合肥供电公司 Remote meter reading method and system for intelligent electric energy meter
CN114665752A (en) * 2022-05-25 2022-06-24 中山大洋电机股份有限公司 Motor with multiple communication addresses, address selection method, electrical equipment and communication method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527561A (en) * 2003-09-22 2004-09-08 中兴通讯股份有限公司 RS-485 multipoint communication method
CN101764670A (en) * 2008-12-21 2010-06-30 重庆川仪自动化股份有限公司 CRC code check method in data sending process
CN202385121U (en) * 2011-11-28 2012-08-15 广东工业大学 Control system of FSM-based short distance home communication protocol

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1527561A (en) * 2003-09-22 2004-09-08 中兴通讯股份有限公司 RS-485 multipoint communication method
CN101764670A (en) * 2008-12-21 2010-06-30 重庆川仪自动化股份有限公司 CRC code check method in data sending process
CN202385121U (en) * 2011-11-28 2012-08-15 广东工业大学 Control system of FSM-based short distance home communication protocol

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108093492A (en) * 2017-12-26 2018-05-29 上海创程车联网络科技有限公司 A kind of wireless radio frequency modules serial communication method for remote control equipment
CN109951256A (en) * 2019-03-28 2019-06-28 常州索维尔电子科技有限公司 On-board high-voltage power supply integrating device and its communication means and the new-energy automobile high voltage power supply for applying it
CN112289017A (en) * 2020-10-28 2021-01-29 国网安徽省电力有限公司合肥供电公司 Remote meter reading method and system for intelligent electric energy meter
CN114665752A (en) * 2022-05-25 2022-06-24 中山大洋电机股份有限公司 Motor with multiple communication addresses, address selection method, electrical equipment and communication method

Similar Documents

Publication Publication Date Title
CN106453383B (en) UART-based master-slave multi-machine communication system and method
CN110851392B (en) Communication method and communication system based on Modbus RTU protocol
CN100496048C (en) Multi-host communication system
CN109150680B (en) Self-adaptive address-determining networking circuit and method suitable for RS485 bus
US10331610B2 (en) UART with automated protocols
WO2019072218A1 (en) Method and device for signal conversion, home bus system (hbs) circuit, and user equipment
CN102447599A (en) Control system and control method for short-distance home communication protocol based on FSM (Finite State Machine)
CN102957596A (en) Daughter gateway device, system and method for processing data of terminal equipment
CN103475747A (en) Electric energy meter networked system capable of automatically sending address information and sending method thereof
CN202385121U (en) Control system of FSM-based short distance home communication protocol
CN110069437B (en) RS-485 bus polarity self-adaption method based on response frame validity
CN101507193A (en) Method and device for the creation of a communication system based on can communication controllers featuring an increased data throughput
US20130346530A1 (en) Communication system, method for operating such a communication system, and communication module
CN114721317B (en) Network communication control system and method based on SPI controller
CN114500159B (en) Wired communication method and device of central range hood system and electronic equipment
CN107453844A (en) A kind of method and device of smart machine automatic network-building
JP2004531146A (en) Communication apparatus and method supporting carrier sensing multiple access / collision detection (CSMA / CD)
CN201820120U (en) Self-adapting multibus execution mechanism controller
CN109802877A (en) A kind of CAN bus based Communication System Design
CN111385172B (en) Control system, control method and storage medium based on bus
CN104460445A (en) CAN bus communication terminal resistor accessing method
CN110855540B (en) 485 multi-master communication method and system based on single-ring network
CN114168519A (en) Working robot control system based on serial bus communication technology
CN106603430A (en) SOPC-based general data communication interface integration method
CN116684389B (en) Address automatic allocation method and host, slave and communication equipment with same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120509