CN201274489Y - Firmware module structure for intelligent electric appliance - Google Patents

Firmware module structure for intelligent electric appliance Download PDF

Info

Publication number
CN201274489Y
CN201274489Y CNU2008201218795U CN200820121879U CN201274489Y CN 201274489 Y CN201274489 Y CN 201274489Y CN U2008201218795 U CNU2008201218795 U CN U2008201218795U CN 200820121879 U CN200820121879 U CN 200820121879U CN 201274489 Y CN201274489 Y CN 201274489Y
Authority
CN
China
Prior art keywords
module
data
electric appliance
intelligent electric
packet
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.)
Expired - Lifetime
Application number
CNU2008201218795U
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.)
Zhejiang People Electrical Appliance Co., Ltd.
Original Assignee
PEOPLE ELECTRICAL APPLIANCES GROUP CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PEOPLE ELECTRICAL APPLIANCES GROUP CO Ltd filed Critical PEOPLE ELECTRICAL APPLIANCES GROUP CO Ltd
Priority to CNU2008201218795U priority Critical patent/CN201274489Y/en
Application granted granted Critical
Publication of CN201274489Y publication Critical patent/CN201274489Y/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Abstract

The utility model relates to a firmware module structure for intelligent electrical appliances, which comprises a main module, a data package processing module, a data package transmitting module and a byte transmitting module. The main module, the data package processing module, the data package transmitting module and the byte transmitting module are connected in order to form a calling connection. The firmware module structure also comprises a data receiving module; the connection between the main module and the data receiving module is the interrupt calling connection, and the connection between the data receiving module and the data package processing module is the calling connection. The firmware module structure for intelligent electrical appliances can realize the data communication among intelligent electrical appliances through the RS-485 interface specification.

Description

A kind of firmware module structure of intelligent electric appliance
Technical field
The utility model relates to a kind of intelligent electric appliance serial bus, is specifically related to a kind of firmware module structure of intelligent electric appliance.
Background technology
In the prior art, intelligent electric appliance is linked to each other with computer, have multiple mode.For example, adopt USB interface.The deficiency of this mode is that the data transmission distance of USB interface is a 1-2 rice, can't satisfy the demand of practical application.Simultaneously, the plug-in USB device number of USB interface often has only several, and this has influenced user's use.
Chinese patent literature publication number CN2566355 discloses a kind of serial management bus interface module that is applied in the series bus integrated type network management system; it includes a standard 485 chips, is serially connected with two protective resistances at the drive end of described standard 485 chips.Use its serial management bus interface module, under the situation about in being not more than 8 scope, changing regardless of the loadtype of the terminal of network, number of loads, can guarantee the communication robust, reliable between system equipment.
Carry out the technical barrier of data communication function between the unresolved intelligent electric appliance of described prior art by the interface specification of RS-485.
The utility model content
Technical problem to be solved in the utility model provides and a kind ofly can make the firmware module structure of carrying out the intelligent electric appliance of data communication between the intelligent electric appliance by the interface specification of RS-485.
For solving the problems of the technologies described above, the utility model provides a kind of firmware module structure of intelligent electric appliance, comprising: primary module, processing data packets module, packet sending module and byte sending module; Primary module, processing data packets module, packet sending module and byte sending module are followed in series to form and call annexation.
Also comprising data reception module between described primary module and the processing data packets module, is the interrupt call annexation between primary module and the data reception module, between data reception module and the processing data packets module for calling annexation.
The utlity model has positive effect: in the firmware module structure of (1) a kind of intelligent electric appliance of the present utility model, primary module, processing data packets module, packet sending module and byte sending module are followed in series to form and call annexation, thereby have realized that the interface specification by RS-485 carries out data communication between the intelligent electric appliance.
Description of drawings
Fig. 1 is the schematic diagram of the firmware module structure of intelligent electric appliance of the present utility model;
Fig. 2 is the main program block diagram of the firmware module structure of intelligent electric appliance of the present utility model.
Embodiment
(embodiment 1)
See Fig. 1, the firmware module structure of the intelligent electric appliance of present embodiment comprises: primary module 1, processing data packets module 3, packet sending module 4 and byte sending module 5; Primary module 1, processing data packets module 3, packet sending module 4 and byte sending module 5 are followed in series to form and call annexation.Also comprising data reception module 2 between described primary module 1 and the processing data packets module 3, is the interrupt call annexation between primary module 1 and the data reception module 2, between data reception module 2 and the processing data packets module 3 for calling annexation.
See Fig. 2, after the microprocessor MCU in the intelligent electric appliance powers on, shielded communication interface at first, its all of the port of beginningization, memory block, timer and interrupt service routine.Afterwards, allow communication interface work.This process has been guaranteed the interruption that the correct response data communication of MCU produces.
Data Receiving adopts interrupt mode, and this program is an interrupt service routine.
Microprocessor has serial line interface, by the docking port initialization, the working method of interface can be set.A kind of working method is that one when the data back that receives (the 9th) just produces interruption when being 1; Another kind of working method is, no matter the 9th is 0 or 1, as long as there are data all to produce interruption.
Token packet is utilized these characteristics just.Interface at first is set, makes that sending data back one (the 9th) is at 1 o'clock, just produce the working method of interrupting.The 9th of token packet is set to 1, and when sending token packet, microprocessor linked all produces interruption on all end points.Having only the end points identical with own address to change the working method of interface, is 0 or 1 no matter form the 9th, as long as there are data all to produce interrupt function, is referred to as the data-interface state.The working method of other end points is constant.It is non-1 to send the 9th of information with aft engine like this, therefore, has only this end points to receive.Other end points does not respond.Formed a data pipe like this between main frame and the end points.
After the data communication between main frame and the end points was finished, the main frame transmission path was cancelled bag, and the microprocessor on this end points changes the working method of interface, cancels data pipe.
Produce when interface receives information and interrupt, microprocessor just can conclude it is data by judging the state of interface, and still bag is a token packet, or the bag of other type.If token packet and identical with end-point addresses just changes interface and becomes data-interface.If this end points is the Data Receiving interface, by judge receiving first byte of bag, just can concludes that the type of bag is confirmed bag one by one, not confirming to wrap, path cancels bag, packet.
Different data are surrounded by different processing methods, confirm bag, do not confirm that bag is provided with corresponding sign; Cancel when bag when receiving path, microprocessor changes Interface status, becomes non-data-interface; When receiving packet, when receiving 131 bytes, be provided with and receive packet sign and bag processing sign, when main program detects bag processing sign, call packet handler.
This program mainly realizes receiving main frame and sends the information processing program.The total three major types of bag that end points receives from main frame:
1) packet class
Packet is divided into 8 kinds of forms again, and each byte has clear and definite definition (the data stipulations of IASB bus are seen in concrete definition) in every kind of form.After receiving packet, at first carry out CRC check, when incorrect, send and do not confirm bag, requesting host resends; When correct, send and confirm bag, and carry out the fractionation of packet, or the group bag send according to the data type of input, output.
2) handshake packet class
Handshake packet is divided into to be confirmed handshake packet and not to confirm handshake packet.When end points after main frame sends packet, main frame just sends the bag of this type to end points.Confirm handshake packet, illustrate that the data that end points sends are correctly received by main frame.The affirmation handshake packet is handled in the Data Receiving program; Do not confirm handshake packet, illustrate that the data host reception of end points transmission is incorrect, at this moment, end points should resend data.For fear of sending data repeatedly, cause intelligent electric appliance microprocessor deadlock phenomenon, be provided with retransmission counter here, when retransmitting number of times above a certain limit, end points stops retransmit operation.
3) path is cancelled bag
Path is cancelled bag, and after main frame and endpoint communication finished, main frame was cancelled the bag of communication data pipeline.Path is cancelled bag and is handled in the Data Receiving program.
The information router is divided into two levels, bag router and byte router.What the former realized is towards the sending function that wraps; What the latter realized is by the byte sending function with bag.
After calling bag transmission journey, at first differentiate the type of the packets of information that will send.The type decided of packets of information the byte number that will send.According to the communication protocol of IASB, handshake packet is 1 byte, and packet is 131 bytes.At this moment, send one by one in order and get final product.
There are many situations can produce end points and send overtime mistake.For simplified process method, when time-out error occurring, end points will change the data receiving state of communication port, and disconnection is connected with main frame.If general mistake, during call endpoints, will once more set up once more by connection for main frame.Can not bring serious consequence.
The byte router, the main peace that realizes sends the function of data to the IASB bus according to the position mode.Before sending data, judge whether transmission buffer is empty in the serial line interface, for sky then sends, otherwise waits for.
Cause the deadlock phenomenon for fear of makeing mistakes, added the wait timeout judgement in this program.The method that realizes is that transmission buffer of every judgement adds 1 for the chronoscope counting unit.When this unit numerical value exceeds certain limit, think overtime makeing mistakes.
Overtime reason is a lot, and one of them is because end points and bus disconnect, and causes NULI character in the transmission buffer, if do not handle, can cause the microprocessor of intelligent electric appliance to crash.For fear of the generation of this phenomenon, adopted end points initiatively to disconnect the method for path with main frame.If not because bus failure, but that accidental cause causes is overtime, and processing method can cause main frame to think that end points is the result of sky like this.But main frame during the paging end points, promptly can recover to connect next time, can not cause serious consequence.

Claims (2)

1, a kind of firmware module structure of intelligent electric appliance is characterized in that: comprising: primary module (1), processing data packets module (3), packet sending module (4) and byte sending module (5); Primary module (1), processing data packets module (3), packet sending module (4) and byte sending module (5) are followed in series to form and call annexation.
2, the firmware module structure of a kind of intelligent electric appliance according to claim 1, it is characterized in that: also comprise data reception module (2) between described primary module (1) and the processing data packets module (3), between primary module (1) and the data reception module (2) is the interrupt call annexation, between data reception module (2) and the processing data packets module (3) for calling annexation.
CNU2008201218795U 2008-07-29 2008-07-29 Firmware module structure for intelligent electric appliance Expired - Lifetime CN201274489Y (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNU2008201218795U CN201274489Y (en) 2008-07-29 2008-07-29 Firmware module structure for intelligent electric appliance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNU2008201218795U CN201274489Y (en) 2008-07-29 2008-07-29 Firmware module structure for intelligent electric appliance

Publications (1)

Publication Number Publication Date
CN201274489Y true CN201274489Y (en) 2009-07-15

Family

ID=40884828

Family Applications (1)

Application Number Title Priority Date Filing Date
CNU2008201218795U Expired - Lifetime CN201274489Y (en) 2008-07-29 2008-07-29 Firmware module structure for intelligent electric appliance

Country Status (1)

Country Link
CN (1) CN201274489Y (en)

Similar Documents

Publication Publication Date Title
CN102819512B (en) A kind of full-duplex communication device based on SPI and method thereof
EP0156557A2 (en) Transceiver for multi-drop local area networks
CN102984059B (en) Gigabit Ethernet redundancy network interface card and link switching condition criterion output control method thereof
CN103777538B (en) The baud rate automatic matching method of controller and CAN
CN107832250B (en) Master-slave communication time sequence method based on SPI
CN110297800B (en) Method and system for realizing stable communication between main control chip and security chip
CN104794089A (en) Improved UART communication method, device and system suitable for single chip microcomputers
CN109495215A (en) A kind of communication means of half-duplex bus, system and device and readable storage medium storing program for executing
CN103577362B (en) Method for improving data transmission and related computer system
CN101345680B (en) Operation method of communication system
CN101393542B (en) Embedded equipment and method for supporting USB interface by GPIO terminal port
CN108365944A (en) A kind of communication means of half-duplex bus, system and room control system
CN108901012A (en) A kind of low-power consumption bluetooth big data divided stator frame method
CN101345681B (en) Operation method for connecting main unit of intelligent electric appliance through serial bus
CN107844441A (en) The means of communication and device of veneer
CN113792003A (en) Single bus communication unit, system and method
CN102353118B (en) Control method for judging master-slave relation of double wire controllers of air conditioner
CN201274489Y (en) Firmware module structure for intelligent electric appliance
CN105634894B (en) A kind of enhanced CAN bus data re-transmitting method and device
CN101345682B (en) Operation method for main unit of intelligent electric appliance serial bus
CN109068328B (en) Secure network communication method, terminal and system
CN106788916A (en) For the data transmission method and data transmission device of bus
CN104834624B (en) A kind of anti-interference method of iic bus interface
CN104765710B (en) A kind of method of work of the card reader comprising dual processor
CN114168519A (en) Working robot control system based on serial bus communication technology

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: ZHEJIANG PEOPLE ELECTRICAL APPLIANCE CO., LTD.

Free format text: FORMER OWNER: PEOPLE ELECTRICAL APPLIANCES GROUP CO., LTD.

Effective date: 20140528

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20140528

Address after: 325604, Yueqing, Zhejiang province Liushi town wide industrial zone

Patentee after: Zhejiang People Electrical Appliance Co., Ltd.

Address before: 325604 Liushi people's Industrial Park, Zhejiang, Yueqing

Patentee before: People Electrical Appliances Group Co., Ltd.

CX01 Expiry of patent term

Granted publication date: 20090715

CX01 Expiry of patent term