ZigBee Tour (v): Several important CC2430 basic experiments--serial communication
first, the connecting link
In the wireless sensor network, the CC2430 needs to send the collected data to the host computer (ie pc), while the host computer needs to transmit the control information to the CC2430. All this is inseparable from the transmission of information between the two. In this section, we will learn how to realize the serial communication between
column of each row, forming the c*Arcs[t][t] The adjoint matrix of the original matrix, the series of n matrices, Ans[t][t]*/void Getastart (float arcs[t][t],int n,float ans[t][t]){int i,j,k,t;float temp[t][t];if (n==1){Ans[0][0] = 1;//guarantees the inverse of the matrix of an element to its reciprocalReturn}for (i=0;i{for (j=0;j{for (k=0;k{for (t=0;t{Temp[k][t] = arcs[k>=i?k+1:k][t>=j?t+1:t];}}Ans[j][i] = Geta (temp,n-1);if ((i+j)%2 = = 1){Ans[j][i] =-ans[j][i];}}}}Sensor.h#ifndef sensor_h_in
Recently, when the ZigBee protocol was simulated in NS2. after the energy model was added, it was found that all nodes were green, and the changes in node color in the program were ineffective, you cannot add tags to a node. After carefully observing the source code, we found that the following two lines of the void mac802_15_4mac.cc line 919th: Recv (packet * P, Handler * h) function are in the p802_15_4mac.cc file:
If (! Nam802_15_4: emstatus)Nam80
1. Io Configuration
Three registers are required for the configuration of the IOS port of the standard.
IO port register
P0
P1
P2
Address
0x80
0x90
0xa0
Pxsel
P0sel
P1sel
P2sel
Address
0xf3
0xf4
0xf5
Px [] function to set registers. The default is normal IO port (0: normal IO port 1: second function)
Pxdir
P0dir
P1dir
P2dir
Address
0xfd
0xfe
0xff
Px [] inpu
We need to configure three registers: p1sel, p1dir, and p16b. The functions of the I/O port are shown in the following table: (For details, refer to the datasheettings)
Link https://pan.baidu.com/s/1nLjYI8LgqxPH6WHd_n1Szw for the cpu30 datasheettings
* P1sel (0: Common IO port 1: second function)* P1dir (0: Input 1: Output)* P1indium (0: Pull up/pull down 1: three States)
1 # include
1 # include
This piece of code is the result of a streaming lamp. I just had three lights on this baseboard, A
The PIN mapping scheme of the timer 1 is a standby 2 scheme: P07 corresponds to Channel 3, p06-Channel 4, p12-Channel 0, p11-Channel 1, p10-channel 2~output comparison mode for timer 1: In output comparison mode, channel-dependent IO is set to output mode. (What is the output comparison mode, operating mechanism) after the timer starts, the content of the counter is compared with the content T1CCNH:T1CCNL in the channel comparison register. If the two contents (values) are equal, the output pin
informationThere must be some advantages to adding this macro definition. But the problem also comes, assuming that the terminal wants to add another network of coordinators, both Panid and channels are the same.No matter how many times you reboot, the new coordinator is not added. What should we do then?As a matter of fact ti takes this into account, here is the official noteApplication wants to delete the stored NV information It just needs to set the Zcd_nv_startup_option as explained below
Reference Post http://www.deyisupport.com/question_answer/wireless_connectivity/zigbee/f/104/t/61232.aspxFeel if it is in the same network, then all the Panid and extension Panid are the same, that Panid limited to 0x3fff, so we can use 64bit extension Panid as the designated address, specific methods refer to the above post, TI The engineer recommends the following:It is recommended to use Extendpanid node selection to join a specific network, genera
ZigBee Serial printing problem
When the endpoint sends data to the coordinator, it is accompanied by the network address of the node in the data stream, and sometimes cannot be printed by the PC side. 1. There may be a problem with the serial software:
Use several serial port software, sometimes appear stop, or garbled behavior, in after many Exchange software, found **securecrt** This software is good, solve most of the problem
2. The data sent
Environment Monitoring System Based on zigbee and tiny4412 Development Board, zigbeetiny4412
1. Build the Development Board Environment
1. layout of tiny4412 linux
Reference blog: http://www.cnblogs.com/luoxiang/p/4186391.html
2. boa Server Construction
Download boa Source package: http://www.boa.org/boa-0.94.14rc21.tar.gz
Boa-0.94.14rc21.tar.gz cd/home tar zxf
Cd boa-0.94.14rc21./configure cd/src modify Makefile file CC = arm-linux-gcc CPP = arm-
port.Three. Procedures#include #define UINT unsigned int #define UCHAR unsigned char#define LED1 P1_0//define P1_0 Port as LED1 control end #define LED2 p1_1//define P1_1 Port as LED2 control end#define LED3 p1_4//define P1_4 Port as LED3 control end/* Function Name: io_init function Description: led_io initialization function input parameter:None output parameter: None return value: None */void Io_init (void){P1dir |= 0xFF; P1 Port defined as outputLED1 = 0; Light LED1.LED2 = 0; Light LED2.LED
The data in the experiment is already done, so I downloaded a brand-new zstack-2.5.1a to do the experiment, follow the steps, found a lot of problems.The first step is to configure the serial port.Mt_uartinit in the mt_uart.c (); BaudRate is set to 115200 (default is 38400), FlowControl is set to false.
The second step, predefined macros.Mt_uartinit () There is a small 1, 2 lines select different data processing functions according to predefined ztool or Zapp. The rear P1 and P2 are serial 0
. When the transfer is complete, the Uxcsr.tx_byte bit is set to 1. When the USART receive/Send data buffer registers are ready for receiving new sending data, an interrupt request is generated. This interrupt occurs immediately after the start of the transfer, so that when the byte is being sent, the new byte can be loaded into the data buffer.Second, the UART data receiveclkconcmd=~0x40; Set the system clock source to 32MHZ Crystal oscillatorwhile (clkconsta0x40); Wait for crystal stabilityclk
a ZDO Unbind Request to the first device. The End Device Bind is toggle process and so the Unbindis sent first-to-remove an existing bind entry.2. Wait for the ZDO Unbind Response, if the Response status is Zdp_no_entry, send a ZDO BindRequest to make the binding entry in the source device. If The response status is Zdp_success,Move the cluster ID for the first device (the unbind removed the Entry–toggle).3. Wait for the ZDO Bind Response. When received, move on to the next cluster ID for the f
);}}The type of the device is read first, and if it is a coordinator, the device is allowed to bind and the binding time is 0xff, which means that the device is allowed to bind at all times. If it is a different device type, the device binding request is sent. After power on, found that the device can automatically join the network and can be automatically bound, when we again touch the switch device on the light control button, the corresponding light status on the coordinator is sent to flip.
The following is reproduced content, because learning ZigBee, a little to tidy up a bit, I hope the author do not blame.First, download zstack-cc2530.2.5.1a URL http://download.csdn.net/detail/thanksgining/8328925After download:Second, installation zstack-cc2530.2.5.1aAfter installation:Components: As the name implies, this is a library file, which puts some zdo,driver,hal,zcl and other library codeDocuments: This needless to say that we all know is t
The following error resolution occurs when compiling a ZigBee program using IAR Embedded Workbench:ERROR[E12]: Unable to open file ' C:\Program files\iar systems\embedded Workbench 5.3\8051\config\lnk51ew_cc2530f256.xcl ‘The error should not be found in the config file.Here's how to fix it:If you are a win7 system and are 64-bit, then you need to modify the link path, the use of 32-bit system when the installer is the default in \program Files, if it
the direction of the binding problem : When using Zdp_enddevicereq () to bind, there are four parameters about the input and output clusters, if a-side output cluster can match the B-party input cluster, then the binding is successful, and the binding table is established in a-party (the party that owns the output cluster). Also, if the input cluster of a can match the output cluster of B. Then two-way success. A binding table is also created in B at this point. At this point A and B can control
Regardless of which MUC serial port for our experimental debugging is very convenient and practical, we can be involved in the program of some intermediate or other program state information printed out to display on the computer for debugging, many MUC and PC communication is carried out through the serial port. ZigBee is no exception.The USART mode operation has the following characteristics:1, 8-bit or 9-bit load data2, odd check, even check or no
Binding in ZigBee is managed by the APS layer. In addition to binding table management, the APS layer also provides group table management, fast address search, and other service functions. The application layer cannot directly call the data service in the APS layer to transmit data. It can only use the ad_datarequest function encapsulated in the AF layer to transmit data.
After reading many related documents, I mentioned that the bound service def
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.