Communication module design of CC2430 and ZigBee2006 protocol stack

Communication module design of CC2430 and ZigBee2006 protocol stack

Abstract: Introduces the basic characteristics of the CC2430 chip and the basic content of the ZigBee2006 protocol stack. The hardware design of the wireless communication module with CC22430 chip as the core and the software design based on the ZigB-ee2006 protocol stack are discussed. While realizing wireless communication between short-distance multi-network nodes, a serial port is used to realize the data transmission between the wireless communication module and the terminal acquisition part and the local control part.

Introduction With the advancement of technologies such as microelectronics technology, computing technology and wireless communication, wireless sensor networks are listed as the 21 most influential technologies in the 21st century and one of the 10 world-changing technologies. It can monitor, sense and collect information of various environments or monitoring objects in real time and process them. The sensor node is the basic unit that constitutes a wireless sensor network and the basic platform that constitutes a wireless sensor network.
ZigBee is an emerging short-range, low-rate wireless network technology. It is a set of technical standards related to networking, security, and application software developed based on the IEEE 802.15.4 wireless standard. It has the advantages of low power consumption, low cost, safety, and flexible working frequency band. By forming a wireless sensor ZigBee network with sensors, automatic data collection, analysis, and processing become easier, and can be used as an important part of the decision-making assistant system.

1 CC2430 and ZigBee protocol stack architecture CC2430 is a true system-on-chip (SoC) CMOS solution that can improve performance and meet the low-cost, low-power requirements of the 2.4 GHz ISM band application based on ZigBee. It combines a high-performance 2.4GHz DSSS (direct sequence spread spectrum) RF transceiver core and an industrial-grade compact and efficient 8051 controller. CC22430 integrates ZigBee radio frequency (RF) front end, memory and microcontroller on a single chip, uses an 8-bit MCU (8051), has 32/64/128 KB of programming flash memory and 8 KB of RAM, and also contains analog / digital Converter (ADC), timer (TImer), AES128 security coprocessor, watchdog timer (watchdog TImer), sleep mode timer of 32 kHz crystal oscillator, power-on reset circuit, power-down detection circuit and 21 Programming I / 0 pin. The target code of the 8051 core of the CC2430 is compatible with the standard 8051 microprocessor, and software development can be performed using the standard 8051 assembler and compiler. Each of its 21 programmable I / O pins can set a set of bits and bytes of SFR register through software, so that these pins can be used as ordinary I / O ports or as peripheral devices connected to ADC, timer or USART components I / O port use.
The ZigBee protocol stack consists of a set of sub-layers, each of which provides a set of specific services for its upper layer: data entities provide data transmission services, and management entities provide all other services. Each service entity provides a service interface for the upper layer through a service access point (SAP), and each SAP provides a series of basic service instructions to complete the corresponding functions. The architecture model of the ZigBee protocol stack is shown in Figure 1. The IEEE 802.15.4 standard defines the physical layer (PHY) and the medium access control sublayer (MAC); the ZigBee alliance defines the network layer and the application layer (APL) Frame design.


The first version of the ZigBee protocol stack was released in 2004 and is called ZigBee2004. ZigBee2004 is a full source code protocol stack. This protocol stack already has the concept of a network and can complete some simple communications. However, it can only form a string network and a star network. If you need to set up a mesh network, you must add procedures. In addition, it does not do very well in terms of security and routing. The ZigB-ee2006 protocol stack solves the network networking problem well. The entire protocol stack has better security, stronger hierarchy, and improved power consumption. It also implements a mesh network. In the ZigBee-2006 protocol stack, the bottom drivers of CC2430 have all been solidified in the protocol stack and can be directly called.

In summary, the CC2430 chip is used as the hardware core chip of the wireless communication module, and the software part uses the ZigBee2006 protocol stack to realize the communication function between the wireless modules.


2 Hardware design The wireless communication part is an important data transmission channel in the monitoring system. It not only needs to realize the data receiving and sending functions between the wireless communication modules, but also needs to provide a data interface to the terminal data collection part and the local main control system to connect . The system structure is shown in Figure 2.


Figure 3 shows the hardware schematic of the wireless module. The circuit selects CC2430 chip as the core CPU of the wireless sensor network node. Select a 32.768 kHz quartz resonator (X2) and 2 capacitors (C441 and C431) to form a 32.768 kHz crystal oscillator circuit; select a 32 MHz quartz resonator (X1) and 2 capacitors (C191) And C211) form a 32 MHz crystal oscillator circuit. The voltage regulator can supply power to all internal power supplies that require 1.8 V. Capacitors C241 and C421 are used as decoupling capacitors for power supply filtering to improve the stability of the chip. In the circuit, J1 is a 10-pin JTAG emulator interface, J2 is a 3.3 V power interface, and J3 is a CC2430 chip expansion output port. The SPI port and the entire PO I / O port are mainly reserved on the expansion output port. Two LED indicators are designed as circuit debugging indicators. An unbalanced antenna is used. In order to make the antenna performance better, an unbalanced transformer is connected between the antenna and the CC2430. The unbalanced transformer is composed of capacitor C341 and inductors L321, L331, L341 and a PCB microwave transmission line. The entire structure meets the requirements of RF input / output matching resistance (50 Ω).

3 Protocol stack software design Software development software environment: IAR 7.30B, data analyzer, serial port debugging tools and hardware driver software, etc .; hardware environment: computer, CC2430 development board, etc.
The system software is based on the ZigBee2006 protocol stack provided free by TI / Chipcon, and is based on the GenericApp routine in the ZStack-1.4.3-1.2.1 version. The GenericApp example has complete basic functions and realizes wireless network data transmission on ZStack. The routine has no redundant functions, so it is a typical ZStack template, which provides users with a common template that can be used to build their own applications. Therefore, the method of establishing a project is mainly to modify the application layer (APP) program.
The wireless communication module respectively realizes the connection with the data acquisition part and the local main control part through the serial port. Therefore, the main function of the application layer software is to achieve serial data transmission and reception and wireless network data transmission. A real-time operating system is embedded in the ZStack program for unified scheduling of network operation, node joining, data sending and receiving and other functions. Its working mechanism is mainly a multi-task event operation mechanism. For the same task, multiple events may occur and different event processing needs to be performed. For convenience, the event processing function for each task is implemented in an event processing function, and then the event processing function of a task is called according to the task ID number (task id) and the specific event of the task. After entering the event processing function of the task, according to the event to determine which event of the task occurred, and then perform the corresponding event processing. The specific process of task processing is shown in Figure 4.


The following describes the serial port part and the wireless receiving and sending part of the program in detail.

3. Part of the serial port program (1) Serial port initialization is mainly to set halUARTCfg_t structure member value:

By assigning a value to halUARTCfg_t, you can set the baud rate, number of characters, data bits, stop bits, parity bits and hardware flow control. Among them, call-BackFunc is a custom setting serial port callback function, that is, once the serial port has data transmission, OSAL will automatically go to the custom callback function to perform the custom operation.
(2) The serial port callback function first calls the Hal_UART_RxBufLen (uint8 port) function to determine the length of the serial port data, and then calls HalUARTRead (uint8 port, uint8 * buf, uintl6 len) to read the serial port data to the custom serial port data buffer and call The osal_set_event (byte task_id, UINTl6 event_flag) function sends an event signal to wirelessly send data.
3.2 Partial procedures for wireless receiving and sending (1) Wireless receiving When data is sent to the application layer by wireless, the application layer will send an AE_INCOMING_MSG_CMD message event.
case AF_INCOMING_MSG_CMD:
GenericApp_MessageMSGCB (MSGpkt);
break:
This means that the AF_INCOMING_MSG_CMD message event is received, and then the information processing function GenericApp_MessageMSGCB (MSGpkt) of the received message event is called to start receiving data and send the received data through the write function of the serial port HalUARTWrite (uint8 port, uint8 * buf, uintl6 len) .
(2) Wireless transmission When the serial port has data input in the serial port callback function, the application layer will send a GENERICAPP_SEND_MSG_EVT message event.

Call GenericApp_SendThmMessage () data sending function, specific to the ZigBee2006 protocol stack provided by TI / Chipcon company is AF_DataRequest () function, the specific form is as follows:


Conclusion In this paper, the hardware of the wireless communication module is designed with CC2430 as the main body, and ZigBee2006 protocol stack provided free by TI / Chipcon is selected as the software development platform. Through experimental verification, the designed hardware node basically meets the project requirements. After debugging, the serial port can correctly receive and send data, can realize the communication and data transmission of multiple wireless nodes (1 coordinator, 3 terminal devices) around 50 m, and the computer serial debugging software test is correct.

Universal Vacuum Cleaner Ac Motor

Universal Vacuum Cleaner Ac Motor,Ac Motor Vacuum Cleaner,Ac Motor For Vacuum Cleaner,Mini Vacuum Cleaner Motor

Zhoushan Chenguang Electric Appliance Co., Ltd. , https://www.vacuum-cleaner-motors.com