当前位置:网站首页>ZigBee integrated development environment IAR installation

ZigBee integrated development environment IAR installation

2022-07-23 18:58:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

One 、Zigbee summary

1. What is? Zigbee

ZigBee It's a kind of close 、 Low complexity bidirectional wireless communication system , Mainly used for short distance 、 Low power consumption 、 Data transmission between electronic devices with low transmission rate , And it has low power consumption 、 Low cost 、 The large capacity 、 Time is short 、 High reliability and flexible network topology .

Zigbee In essence, it is a way of communication between wireless devices , It is similar to people communicating in Mandarin , Mandarin is a way of communication .Zigbee,Zigbee communication mode ,Zigbee The agreement says the same thing .

Zigbee Its main function is to build wireless LAN .

2. Comparison of various communication modes

bluetooth : Low power consumption , The number of network nodes is small (7~8 individual )

WIFI: The communication rate is relatively high , High power consumption , wait

Zigbee: advantage : Large scale networks can be built , Low power consumption (TI cc2530 Normal working current 8mA, The minimum working current is only a few uA) shortcoming : The communication rate is relatively small ( 250KBPS)

Be careful :Zigbee Just complete the work of data communication , To realize the specific functional system , Usually the Zigbee The module is connected to the computer ( processor ), The computer monitors the whole system by programming .

3. Relevant concepts

Zigbee union : To develop Zigbee The association organization of the agreement ( The United States )

TI( TI ): One Zigbee Chip manufacturer , Mainly Zigbee The protocol is used for promotion and practical application . except TI, also ember, Freescale, wait

Zstack:TI The company to launch Zigbee Protocol stack supported on software . The essence is a pile of sample code .

cc2530:TI Support launched by the company Zigbee A chip of the underlying protocol (8051 MCU core )

​ cc2530F256 TI 58J

IAR: Write Zigbee A software of the program , Integrated development tools , Editor , compiler , Downloader , Emulator .

4.Zigbee Network architecture

​ ZigBee The basis of the agreement is IEEE 802.15.4,ZigBee The league is IEEE 802.15.4 On this basis, the network layer and application layer are redefined .Zigbee Use the global free frequency band for communication , It can communicate on three different frequency bands . The global frequency band is 2.400GHz-2.484GHz, The frequency band used in Europe is 868.0 MHz-868.66MHz, The frequency band adopted by the United States is 902MHz-928MHz. The transmission rates are 250kbps 20kbps and 40kbps.

Two 、IAR Installation and use of software

1.IAR Software installation and registration

2.IAR Project establishment

(1) First create a workspace

​ File–>new–>workspace

(2) Create a project

​ Project–>Create New Project–>Empty project–>0K–> Save to the specified directory

(3) Create a new file –> Save as .c file

(4) hold .c Add files to the project

​ Right click ” project name -Debug”–>Add

(5) compile : Save the workspace to the created project folder

3. Options configuration

“ project name -Debug”–>options

(1)General Options–>Device choice Texas Instruments cc2530F256

​ (2)Linker–>Output–>Override default On the hook ,Allow C-SPY-specific extra output file On the hook

(3)Debugger–>Driver–> choice Texas Instrments

3、 ... and 、 Drive installation

In the device manager , The driver not installed shows SmartRF04EB, After installing the drive , It shows CC2430DB

Hash value error solution 1.Windows key + R, Input shutdown.exe /r /o /f /t 00 , The system will restart a “ Select an option ” 2 from “ Select an option ” On the screen , choice “ Troubleshooting ” , Select from “ Troubleshooting ” The screen “ Advanced options ” , Select from “ Advanced options ” The screen “Windows Startup settings ” , Click on “ Restart ” Button , The system will restart , With “ Advanced startup options ” The screen ; restart 3. This will jump out of the safe mode list after restarting 4. Choose the penultimate , Disable mandatory driver signing , Press the corresponding number . 5. restart , The driver can be successfully installed according to the general method

[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-8BvBttrd-1621863122867)(https://i.loli.net/2021/05/24/B8pGcTQFZU3jb5N.jpg)]

Four 、 Compilation and simulation

5、 ... and 、 Generate Hex File settings

“ project name -Debug”–>options ,Linker–>Extra Output–>Genetare extra outputfile On the hook ,Override defualt On the hook –> Name it .hex file ,output format :intel-extended–>OK

​ After compiling again, it will be in Debug/Exe Generate... In directory .hex file

6、 ... and 、ZigBee Core controller

Wireless communication adopts Ti Zigbee programme .Zigbee Node adoption Ti( TI ) company CC2530,GEC-CC2530 Yes 21 Number of inputs / Output pin , It can be configured as a general digital I/O Or peripherals I/O The signal , peripherals I/O Can be connected to ADC、 Timer or USART etc. .

among 21 individual I/O The pins are divided into 3 Ports ( port 0、 port 1 And port 2, Expressed as P0、P1 and P2), among ,P0 and P1 Each group has 8 individual IO Pin , and P2 Group only 5 The physical objects of pins are shown in the figure .

7、 ... and 、 Code burning test

LED flashing

#include "iocc2530.h"

typedef unsigned char uchar;
typedef unsigned int  uint;

#define LED0 P1_0 // Definition P1.0 The mouth is LED0 Control terminal 
#define LED1 P1_1 // Definition P1.0 The mouth is LED1 Control terminal 

// Light up two LED The lamp 
void led_init(void)
{ 
   
    P1DIR |= 0x03;
    LED0 = 0;
    LED1 = 0;
}

void delay_ms(uint msec)
{ 
    
    uint i,j;
    
    for (i=0; i<msec; i++)
        for (j=0; j<535; j++);
}
void main(void)
{ 
   
    led_init();
    while(1)                  
    { 
   
        LED1 = 0;          
        LED0 = 0;  
        delay_ms(500);       

        LED1 = 1;           
        LED0 = 1;  
        delay_ms(500);   
    }    
}

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/126705.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207231637071294.html