The control system of the intelligent domestic system based on Zigbee wireless communication technology
Technical field
The present invention relates to electronic information communication field, more particularly, to a kind of intelligent family based on Zigbee wireless communication technology
Occupy the control system of system.
Background technology
At present, the international standard of smart home field is not yet ripe, and all big enterprises and mechanism of linked groups set about building
Vertical Network interface standard data host-host protocol and formulation intelligent domestic system internal unit between, but present circumstances is come
See, smart home communications protocol camp is complicated, and each incompatible.With regard to communications protocol, smart home field has had much
Communication protocol, WiFi, bluetooth, ZigBee, Z-Wave etc..Estimate that developer's head when from which kind of agreement is all big
, finally it is likely to be forced to support eight kinds of communication protocols as Homey.Now, Samsung, Nest, ARM put out jointly again
A kind of new agreement Thread.Do not know that Thread can accelerate industry unified standard to be formed, still allow and originally reached the logical of unrest
Letter agreement more " is cut constantly, reason is gone back disorderly ".
Now the more commonly used procotol has WiFi, bluetooth, ZigBee, Z-Wave, but has below presence not
Foot:
1st, the power dissipation ratio of WiFi is larger, is suitable for transmitting substantial amounts of data;
2nd, Bluetooth power consumption ratio is relatively low, but also there is now bluetooth 2.0 and bluetooth 4.0 trouble waters deposited, and does not support
IPv6;
3rd, Z-Wave is dominated by Danish company Zensys, temporarily powerful not enough, selects user very little.
In Design for Smart Home System, on the premise of as keeping standard unified as possible, come for various signal types
Select suitable bus or wireless technology and design master controller oneself become smart home construction matter of utmost importance.In wired mode
In, each sensor and controller connect through bus, its advantage is to simplify the design of each functional unit, and shortcoming is exactly
Connect up many, complex structure, there is also the problem of bus protocol design alternative.
In current intelligent domestic system, system communication module is typically integrated with functional control module, in intelligence
The early stage of energy house system development, smart home production firm is fewer, and each systematic comparison is independent, so can increase system
System is integrated, reduces system cost, has promoted the development of smart home.But the raising with people's living standard, various households set
For quickly growing, the continuous application of house system network technology (wired and wireless technology), using communication module and function control
The integrated traditional intelligence household system of module has the shortcomings of versatility is bad, and system hardly possible is safeguarded and design is dumb.
Content of the invention
For weak point present in above-mentioned technology, the present invention provides a kind of intelligence based on Zigbee wireless communication technology
The control system of energy house system, the intelligent domestic system of the present invention has durability, installs easily, debugging is simple, versatility
The features such as good.
For achieving the above object, the present invention provides a kind of control of the intelligent domestic system based on Zigbee wireless communication technology
System processed, including host node intelligent home network controller and the household network equipment being distributed in each room, described household
The network equipment is all communicated to connect with host node intelligent home network controller, the quantity in described room at least one;
Household network equipment in each room includes partial node intelligent home network and controls router, multiple home equipment, many
The function-driven module of the individual function executing agency as home equipment and multiple partial node intelligent home network controller;Each
Home equipment is interconnected with corresponding function-driven module, each function-driven module and corresponding partial node smart home net
Network controller interacts connection, and each partial node intelligent home network controller all controls road with partial node intelligent home network
It is communicatively coupled by device;The partial node intelligent home network in each room controls router and host node intelligent home network control
Form the Zigbee cordless communication network of this system after being communicatively coupled between device processed;
Each partial node intelligent home network controller and host node intelligent home network controller are all included for controlling entirely
The Zigbee wireless transceiver circuit of the single-chip microcomputer of system, the Wireless transceiver realizing data and transmitting-receiving, communication interface circuit, for remote
GPRS module, the human-computer interaction module conveniently realizing man-machine interaction and offer system work clock letter that journey monitors to home equipment
Number crystal oscillating circuit;
Described Zigbee wireless transceiver circuit, communication interface circuit, GPRS module, human-computer interaction module and crystal oscillating circuit all with single
Piece machine interconnects;Described communication interface circuit is mainly used in the connection with home equipment, data acquisition and furniture is set
The control of standby executing agency, is also connected with PC simultaneously, system is debugged and monitors.
Wherein, each partial node intelligent home network controller described and host node intelligent home network controller all also wrap
Include the power supply that electric energy is provided for system.
Wherein, described single-chip microcomputer is the PICl8LF4620 microcontroller of 40 pin PDIP encapsulation, and this single-chip microcomputer is provided with
MSSP module, described communication interface circuit is turned with serial EEPROM, shift register, display driver and AD by MSSP module
Parallel operation is communicatively coupled;Described MSSP module has two kinds of mode of operations, respectively in SPI mode of operation and I2C interface hardware
Master mode, many host modes and the follower mode supported;When described MSSP module is operated under SPI mode of operation, MSSP mould
Block enters row data communication with Zigbee wireless transceiver circuit and is connected.
Wherein, described single-chip microcomputer also includes EUSART module, and this EUSART module can be configured to and CRT terminal and personal meter
The full duplex asynchronous system of calculation machine communication;EUSART module can also be configured to and A/D or D/A integrated circuit, serial
The half-duplex synchronization system of EPROM communication;Described USART module also includes auto-baud-detect and alignment unit and is used for connecing
Receive the gap character Transmit-Receive Unit automatically wakening up with 12 bit interval characters transmissions during sync interval character;And this EUSART mould
Block is communicated to connect with GPRS module.
Wherein, described crystal oscillating circuit includes the first electric capacity, the second electric capacity and crystal oscillator chip, and one end of described crystal oscillator chip leads to
Cross the first capacity earth, the other end of described crystal oscillator chip passes through the second capacity earth, described first electric capacity and crystal oscillator chip
Common port and the second electric capacity are connected to single-chip microcomputer with the common port of crystal oscillator chip, and export crystal oscillation signal.
Wherein, described Zigbee wireless transceiver circuit be CC2420 radio frequency chip, described CC2420 radio frequency chip wireless
Communication equipment supports that data transmission rate is up to 250kbps and can realize multi-multipoint quickly networking.
Wherein, it is provided with the receiving unit being sequentially connected, low-noise amplifier, frequency conversion list in described CC2420 radio frequency chip
Unit, filter and amplification unit and analog-digital converter, are additionally provided with FIFO buffer area in this CC2420 radio frequency chip;Receiving unit is from antenna
Receive radiofrequency signal, radiofrequency signal first passes around low-noise amplifier and amplifies, then in the intermediate frequency of quadrature frequency conversion to 2MHz
On, formed and while intermediate-freuqncy signal, form two-way component and quadrature component in the same direction;This two paths of signals after filtering with amplify after, directly
Connect analog-digital converter and be converted into data signal;When the SFD pin of CC2420 radio frequency chip is low level, expression receives
The SFD byte of physical frame;The data receiving leaves in the FIFO buffer area of 128 bytes;FIFO buffer area preserves mac frame
Length, mac frame head and three parts of mac frame load data;When CC2420 radio frequency chip sends data, the leading sequence of Frame
Row, frame start separator and frame check sequence produces:During receiving data, the length of mac frame, mac frame head and mac frame load number
It is served only for frame synchronization and CRC check according to three parts;When CC2420 radio frequency chip sends data, using direct quadrature up-conversion,
The in-phase component of baseband signal and quadrature component are directly converted to analog signal by digital to analog converter, after low pass filter,
Direct Conversion is on the channel setting.
Wherein, described CC2420 radio frequency chip is provided with FIFO pin, CCA pin, FIFOP pin, SFD pin, CSn draw
Pin, VERG-EN pin, RESET pin, SCK pin, SO pin and SI pin, described FIFO pin, CCA pin, FIFOP draw
Pin and the state of four expression transceiving datas of SFD pin, and access the input pin of single-chip microcomputer;The output pin of described single-chip microcomputer
Access CSn pin, VERG-EN pin, RESET pin and SCK pin, described SO pin also accesses the input pin of single-chip microcomputer,
The output pin of described single-chip microcomputer also accesses SI pin;After described CC2420 radio frequency chip receives the SFD field of physical frame, meeting exists
SFD pin exports high level, until having received this frame, if starting address identification, after address is debated and known unsuccessfully, SFD pin
Switch to immediately export low level;The state of the buffer area of described FIFO pin and FIFOP pin sign FIFO, if FIFO caching
There is data in area, and FIFO pin exports high level;If receiving FIFO buffer area is sky, FIFO pin exports low level;FIFOP draws
Pin receives one completely when the data receiving FIFO buffer area exceedes the critical value of setting or in CC2420 radio frequency chip
Frame after export high level, critical value can be by the setting of the register of CC2420 radio frequency chip;CCA pin has letter in channel
Number when export high level, and only effective in receive state;Enter in CC2420 radio frequency chip and accept at least 8 symbol weeks of state
After phase, effective channel condition information is just exported on CCA pin for a moment.
Wherein, described GPRS module adopts MC55 module, and described MC55 module is provided with ASC0 communication serial port, described MC55
Module is passed through ASC0 communication serial port and is interconnected with single-chip microcomputer.
Wherein, the long-distance monitoring method of described GPRS module is:
Step 1, communication serial port is initialized;
Step 2, GPRS module is initialized;
Step 3, whether test initialization is successful, if unsuccessful, returns back to step 1, if success, carries out step 4;
Step 4, carries out inquiring about short message and timing sends status message;Carry out step 51 after inquiring short message;Transmission state
Carry out step 52 after information;
Step 51, detects whether to receive new information, if receiving new information, information analysis also being obtained control code and carrying out phase
The process answered;If confiscating, jumping to and proceeding in step 4 to inquire about short message;
Step 52, detects whether to send successfully, if sending successfully, returning and terminating;If after not sending success, jumping to step
Continue in 4 to be timed transmission status message.
Compared with prior art, the control of the intelligent domestic system based on Zigbee wireless communication technology that the present invention provides
System,
This intelligent domestic system mainly includes host node intelligent home network controller, partial node intelligent home network controls route
Device, the function-driven module of function executing agency as home equipment and partial node intelligent home network controller;Each room
Between partial node intelligent home network control and be communicatively coupled between router and host node intelligent home network controller after
Form the Zigbee cordless communication network of this system, be the communication network of whole intelligent domestic system, the changing of this system and method
Enter, have the advantages that:
1) zigbce wireless communication technology is applied in smart home, proposes a kind of employing Zigbee wireless communication technology
Design for Smart Home System scheme.Compared with traditional intelligence household system, have and exempt to connect up, easy to maintenance, operating cost is low, real
When on-line monitoring, the features such as to household inside, various data carry out wireless collection and pass color;
2) in this system, the controller of partial node intelligent home network controller and host node intelligent home network controller is all main
Will be by single-chip microcomputer, Zigbee wireless transceiver circuit, communication interface circuit, GPRS module, human-computer interaction module and crystal oscillating circuit structure
Become so that this system achieves remotely control, wireless receiving and dispatching data, facilitates the functions such as man-machine interaction, and pass through these structures,
Improve household network data transmission credibility;Household network is made to have self-organization, self application;Improve internet security and make
The system of obtaining has more extensibility.
Brief description
Fig. 1 is the schematic diagram of the control system of the intelligent domestic system based on Zigbee wireless communication technology of the present invention;
Fig. 2 is the block diagram of intelligent home network controller in the present invention;
Fig. 3 is crystal oscillating circuit figure in the present invention;
Fig. 4 is the working envelope figure of CC2420 radio frequency chip in the present invention;
Fig. 5 is the annexation figure of CC2420 radio frequency chip and single-chip microcomputer in the present invention;
Fig. 6 is the annexation figure of GPRS module and single-chip microcomputer in the present invention;
Fig. 7 is the flow chart of the remote monitoring of GPRS module in the present invention.
Main element symbol description is as follows:
10th, host node intelligent home network controller 11, household network equipment
12nd, mobile phone 13, internet
111st, partial node intelligent home network controls router
112nd, home equipment 113, function-driven module
114th, partial node intelligent home network controller
20th, single-chip microcomputer 21, Zigbee wireless transceiver circuit
22nd, communication interface circuit 23, GPRS module
24th, human-computer interaction module 25, crystal oscillating circuit
26th, power supply
211st, receiving unit 212, low-noise amplifier
213rd, converter unit 214, filter and amplification unit
215th, analog-digital converter.
Specific embodiment
In order to more clearly state the present invention, below in conjunction with the accompanying drawings the present invention is further described.
Refer to Fig. 1-2, the control system of the intelligent domestic system based on Zigbee wireless communication technology of the present invention, bag
Include host node intelligent home network controller 10 and the household network equipment 11 being distributed in each room, household network equipment 11
All communicate to connect with host node intelligent home network controller 10, the quantity in room at least one;
Household network equipment in each room includes partial node intelligent home network and controls router 111, multiple home equipment
112nd, the function-driven module 113 of multiple function executing agencies as home equipment 112 and multiple partial node smart home net
Network controller 114;Each home equipment is interconnected with corresponding function-driven module, each function-driven module with corresponding
Partial node intelligent home network controller interacts connection, each partial node intelligent home network controller all with partial node intelligence
Router can be controlled to be communicatively coupled by household network;
The partial node intelligent home network in each room controls and carries out between router and host node intelligent home network controller
Form the Zigbee cordless communication network of this system after communication connection;
After Zigbee intelligent network set up by host node intelligent home network controller, the partial node intelligent home network in each room
Router is controlled to be subsequently added this network, thus both have collectively constituted the Zigbee radio house network of a tufted;When need
When a certain home equipment being controlled or monitors, host node intelligent home network controller finds and this home equipment phase
The id information of partial node even, and the partial node intelligent home network that control information is sent to this partial node place room controls road
By device, partial node intelligent home network controls router to forward the information to corresponding partial node intelligent home network again and controls
Device, after partial node intelligent home network controller receives information, sends into corresponding function-driven module;Finally by function-driven
Module is operated accordingly to this home equipment.The present invention is to control function-driven module and partial node intelligent home network
The scheme that device is implemented separately, function control drive module realizes the interface with various home equipments, and the function for home equipment
Executing agency;Host node intelligent home network controller is communicated to connect with mobile phone 12 and internet 13 by GPRS network,
Remote monitoring can be carried out to home equipment by internet and mobile phone;
Each partial node intelligent home network controller and host node intelligent home network controller are all included for controlling entirely
The Zigbee wireless transceiver circuit 21 of the single-chip microcomputer 20, the Wireless transceiver realizing data and transmitting-receiving of system, communication interface circuit 22,
For long-range to the home equipment GPRS module 23 monitoring, the human-computer interaction module 24 conveniently realizing man-machine interaction and offer system
The crystal oscillating circuit 25 of operating clock signals;
Zigbee wireless transceiver circuit, communication interface circuit, GPRS module, human-computer interaction module and crystal oscillating circuit are all and single-chip microcomputer
Interactive connection;Communication interface circuit is mainly used in the connection with home equipment, data acquisition and execute machine to fitment
The control of structure, is also connected with PC simultaneously, system is debugged and monitors.Each partial node intelligent home network controller and
Host node intelligent home network controller all also includes providing the power supply 26 of electric energy for system.Man-machine interaction includes keyboard and LED
Deng conveniently realizing human-computer interaction.
In the present embodiment, single-chip microcomputer 20 is the PICl8LF4620 microcontroller of 40 pin PDIP encapsulation,
Single-chip microcomputer adopt Microchip Technology PICl8LF4620 single-chip microcomputer, PICl8 series be high-performance, CMOS,
It is integrated with the entirely static MCU series of modulus (A/D) converter.PICl8MCU adopts advanced RISC Architecture, support FLASH and
OTP partses.PIcl8 has enhancement mode kernel, 32 grades of storehouses and multiple inside and outside interrupt source.Instruction and data bus is mutual
Detached Harvard structure allows 16 bit instructions and 8 data to transmit in detached bus simultaneously.Two-stage instruction pipeline makes
In addition to programming jump instructs two cycles of needs, remaining all instruction executes in a cycle.Instruction has 77 and (simplifies
Instruction set).In addition it is achieved that the big register set of innovation framework, MCU is made to have the high-performance of 10MIPS.PICl8 device possesses
Special functional module, decreases the use of outer member, therefore reduces cost to greatest extent, improves system reliability simultaneously
Reduce power consumption.Specific function includes programmable low pressure detection (UyD) and programmable under-voltage detection (BOD).PICl8 series is base
Build in other PICmicro MCU, user can smoothly be easily ported to performance and the higher device of function collection
On.In view of the communication of single-chip microcomputer and high frequency chip, and the requirement of the behavior extension of later system and program storage etc., setting
The PICl8LF4620 microcontroller of 40 pin PDIP encapsulation is have selected, it is a to aim at low-power consumption Demand Design when meter
's.Its operating voltage only has 3.3V, can directly communicate with high frequency chip.There is the RAM of 3986B, the FALSH of 64KB simultaneously.
Mainly it is made up of following part:
1)20 interrupt sources, 1 interrupts preferential enable, can be that interrupt source distributes high or low priority;
2) 36 I/0 ports (port A, B, C, D, E);
3) 4 timers (timer 0 may be selected to be 8 or 16, timer 1, and 3 are 16, and timer 2 is 8);
4) 1 CCP (Capture/Compare/PWM) module and 1 ECCP (Enhanced Capture/Compare/PWM)
Module;
5)The serial-port communication of MSSP (Master Synchronous Serial Port) pattern and EUSART (Enhanced
Universal Synchronous Receiver Transmitter) serial-port communication pattern;
6)LPT communication interface;
7)Including multiple reset function such as house dog and upper electricity;
8) 10 A/D (analog-digital converter)
PICl8LF4620 has 36 I/O ports (port A, B, C, D, E), can be used as general purpose I/O.It is provided with this single-chip microcomputer
MSSP module, MSSP module is Master Synchronous Serial Port despotic synchronization serial ports;MSSP module be for
The serial line interface being communicated with other peripheral hardwares or single-chip microcomputer device.Communication interface circuit passes through MSSP module and serial
The external equipments such as EEPROM, shift register, display driver and AD converter are communicatively coupled;MSSP module has two kinds of works
Master mode, many host modes and the follower mode supported on operation mode, respectively SPI mode of operation and I2C interface hardware;
When MSSP module is operated under SPI mode of operation, MSSP module is entered row data communication with Zigbee wireless transceiver circuit and is connected.
In the present embodiment, single-chip microcomputer also includes EUSART module, this EUSART module can be configured to CRT terminal and
The full duplex asynchronous system of the external equipments such as people's computer communication;EUSART module can also be configured to and A/D or D/A collection
Become the half-duplex synchronization system of the peripheral device communication such as circuit, Serial E PROM;USART module also includes auto-baud-detect
Receive with alignment unit with for receiving the gap character that automatically wakening up during sync interval character sends with 12 bit interval characters
Bill unit;And this EUSART module is communicated to connect with GPRS module.Enhancement mode USART module also achieves other functions, including
Auto-baud-detect and calibration, receive during sync interval character automatically wakening up and 12 bit interval characters send.EUSART
For Enhanced Universal Synchronous Asynchronous Rccciver Transmitter enhanced general
Synchronous/asynchronous transceiver.
Further referring to Fig. 3, crystal oscillating circuit includes the first electric capacity C1, the second electric capacity C2 and crystal oscillator chip Y1, crystal oscillator core
The first capacity earth is passed through in one end of piece, and the other end of crystal oscillator chip passes through the second capacity earth, the first electric capacity and crystal oscillator chip
Common port and the common port of the second electric capacity and crystal oscillator chip be connected to single-chip microcomputer, and export crystal oscillation signal OSC.
PICl8F4620 has 10 kinds of different crystal oscillator mode of operations, by register FOSC3:The configuration of FOSCO, can select wherein
One kind, the system adopt external crystal-controlled oscillation oscillation mode, as shown in Figure 3.
In the present embodiment, Zigbee wireless transceiver circuit be CC2420 radio frequency chip, CC2420 radio frequency chip wireless
Communication equipment supports that data transmission rate is up to 250kbps and can realize multi-multipoint quickly networking.CC2420 radio frequency chip
The CC2420 radio frequency chip that semiconductor company of Norway Chipcon releases, is a 2.4GI- meeting IEEE802.15.4 specification
Iz radio frequency chip, is already used to develop Zigbee equipment and the product of the PAN network such as industrial wireless sensing and home intranet.Should
Device includes numerous additional functionalities, is the RF device that first item is applied to Zigbee product.It is based on Chipcon company
SmartRF03 technology, is made with 0.18um CMOS technology, only needs few external component, stable performance and power consumption is extremely low.
The selectivity of CC2420 and sensitivity indices exceeded IEEE802.15.4 standard requirement it can be ensured that short haul connection effective
Property and reliability.
Further referring to Fig. 4, in CC2420 radio frequency chip, it is provided with the receiving unit 211 being sequentially connected, low noise amplification
Device 212, converter unit 213, filter and amplification unit 214 and analog-digital converter 215, are additionally provided with FIFO in this CC2420 radio frequency chip
Buffer area;Receiving unit receives radiofrequency signal from antenna, and radiofrequency signal first passes around low-noise amplifier and amplifies, then just
Hand over and be down-converted on the intermediate frequency of 2MHz, formed and while intermediate-freuqncy signal, form two-way component and quadrature component in the same direction;This two-way is believed
Number after filtering with amplify after, directly data signal is converted into by analog-digital converter;Follow-up process, such as automatic gain control
System, final Channel assignment, despreading and byte of sync etc., all be enough to the formal layout of data signal.CC2420 radio frequency chip
When SFD pin is low level, represent the SFD byte that have received physical frame;The data receiving leaves the FIFO of 128 bytes in
In buffer area;FIFO buffer area preserves length, mac frame head and three parts of mac frame load data of mac frame;CC2420 radio frequency
When chip sends data, the targeting sequencing of Frame, frame start separator and frame check sequence produces:During receiving data, MAC
The length of frame, mac frame head and three parts of mac frame load data are served only for frame synchronization and CRC check;CC2420 radio frequency chip is sent out
When sending data, using direct quadrature up-conversion, the in-phase component of baseband signal and quadrature component are directly changed by digital to analog converter
For analog signal, after low pass filter, in Direct Conversion to the channel setting.
Further referring to Fig. 5, CC2420 radio frequency chip is provided with FIFO pin, CCA pin, FIFOP pin, SFD draw
Pin, CSn pin, VERG-EN pin, RESET pin, SCK pin, SO pin and SI pin, FIFO pin, CCA pin,
FIFOP pin and the state of four expression transceiving datas of SFD pin, and access the input pin of single-chip microcomputer;The output of single-chip microcomputer
Pin accesses CSn pin, VERG-EN pin, RESET pin and SCK pin, and SO pin also accesses the input pin of single-chip microcomputer,
The output pin of single-chip microcomputer also accesses SI pin;After CC2420 radio frequency chip receives the SFD field of physical frame, can be in SFD pin
Output high level, until having received this frame, if starting address identification, after address is debated and known unsuccessfully, SFD pin switchs to immediately
Output low level;The state of the buffer area of FIFO pin and FIFOP pin sign FIFO, if FIFO buffer area has data,
FIFO pin exports high level;If receiving FIFO buffer area is sky, FIFO pin exports low level;FIFOP pin is receiving
The data of FIFO buffer area exceedes during the critical value of setting or after CC2420 radio frequency chip receives a complete frame
Output high level, critical value can be by the register setting of CC2420 radio frequency chip;CCA pin exports when channel has signal
High level, and only effective in receive state;After the entrance of CC2420 radio frequency chip accepts at least 8 symbol periods of state,
Effective channel condition information is exported on CCA pin for a moment.1.8V operating voltage is used inside CC2420 radio frequency chip, thus
Power consumption is very low, is suitable for battery powered equipment:External digital interface uses 3.3 v voltages, so can keep patrolling with 3.3v
Collect the compatibility of device.It is integrated with a direct current stabilizer on piece, 3.3v voltage conversion can be become L8V voltage.So
Equipment for only 3.3 V power supplys is it is not necessary to extra voltage conversion circuit just can normal work.CC2A20 radio frequency chip
The transmitting-receiving of radiofrequency signal adopts differential mode to transmit, and its optimal differential load is 115+j180 ohm, and impedance matching circuit should
It is adjusted according to this numerical value.If using single ended antenna, need using balance/non-equilibrium change-over circuit, optimal to reach
Transmitting-receiving effect.CC2420 radio frequency chip needs to be used for the transmitting-receiving of 250kbps data by the reference clock of 16MHz.During this reference
Clock can come from external clock reference, it is possible to use internal crystal oscillator oscillation body device produces.If using external clock, directly from
XOSCl6 Ql pin introduces, and XOSCl6 02 pin keeps hanging:If using crystal inside oscillator, crystal is connected on XOSCl6
Between Q1 and XOSCl6 02 pin.The accuracy of CC2420 requirement clock source should be within scholar 40x10.SPI interface by CSn,
Tetra- pin compositions of SI, S0 and SCLK.Processor accesses CC2420 internal register and memory by SPI interface.Accessing
During, CC2420 be SPI interface from equipment, receive the clock signal from processor and chip selection signal, and in processor
Control under execute input-output operation.SPI interface is all alignd with clock falling edge when receiving or sending data.
Further referring to Fig. 6, GPRS module adopts MC55 module, and MC55 module is provided with ASC0 communication serial port, MC55
Module is passed through ASC0 communication serial port and is interconnected with single-chip microcomputer.MC55 module is powered using 3.3v~4.8V power supply, it is necessary to have
The electric current peak-to-peak value of 2A, it has two universal asynchronous communication serial port ASC0 and ASCl meeting II u.TV.24 agreement, and they are all
Stand in DCE (defining on data communications equipment tears field, this thus with the UART interface of FPGA need not wire jumper, connection figure such as 6
Shown.
GPRS module is to carry out system remote monitoring by AT order, GPRS software overall design flow chart as shown in fig. 7,
The long-distance monitoring method of GPRS module is:
Step 1, communication serial port is initialized;
Step 2, GPRS module is initialized;
Step 3, whether test initialization is successful, if unsuccessful, returns back to step 1, if success, carries out step 4;
Step 4, carries out inquiring about short message and timing sends status message;Carry out step 51 after inquiring short message;Transmission state
Carry out step 52 after information;
Step 51, detects whether to receive new information, if receiving new information, information analysis also being obtained control code and carrying out phase
The process answered;If confiscating, jumping to and proceeding in step 4 to inquire about short message;
Step 52, detects whether to send successfully, if sending successfully, returning and terminating;If after not sending success, jumping to step
Continue in 4 to be timed transmission status message.
AT is the prefix of attention, and Chinese looks like for " attention ", and llP bends the attention that l plays receiver, and order is presented herein below,
Institute is same for use as order prefix.In mobile station software, upper layer application calls GSM/GPRS related service by sending AT order.
(ACI AT Command Interpreter, is also called application control interface Application to AT command interpreter
Control Interface) play a part to form a connecting link:(AT order 1 will solve downwards for the request of responsible process service upwards
Protocol stack is given in instruction after analysis in the way of primitive, includes error handling processing simultaneously.From the point of view of software encapsulation, AT order
Interpreter is actually and provides the functional interface calling lower-layer protocols stack to provide for upper layer application.As same API
(Application Programming Interface, API).AT order provides data terminal equipment
(Terminal Equipment, hereinafter referred to as TE) control GSM/GPRS mobile communication module (Mobile Terminal, below
The text interface of abbreviation MD, can control MT to a certain extent by AT order TE, and succeed or failure feedback.AT
Order is complex, and the system only uses the part being directed to short message.
The several specific embodiments being only the present invention disclosed above, but the present invention is not limited to this, any ability
What the technical staff in domain can think change all should fall into protection scope of the present invention.