Hi, I am using cc2510 for measuring temperature. I don't have any experience using this hardware before. I started with a sample project from simpliciTI. I want to build a star network and I want to use the sample AP_as_Data_Hub as a starting point. Which part of the code should I modify? And how can I get the measured values from the packets transferred? any sample on ADC?
Hi,
i think it would be better for you if you take the eZ430-RF2500 Sensor Monitor Demo (http://www.ti.com/litv/zip/slac139f), it does pretty much the same what you are trying to do. Altough the demo was made for the dual chip solution on eZ430-RF2500 (MSP430F2274+CC2500), on application level, the code should be usable for different platform.
Regarding the ADC sampling code, you can refer to the CC2510 basic example source code (http://www.ti.com/litv/zip/swrc117).
Hope this helps.
Regards,
Leo Hendrawan
Thank you very much. They are very helpful. In the main_ED.c file of the eZ430-RF2500 Sensor Monitor Demo, there is a part about creating random address. Is that necessary? I will be measuring temperature using 6 sensors and it's really important for the AP to know where the data are coming from. In AP_AS_DATA_HUB sample project for cc2510, if I change the value of "THIS_DEVICE_ADDRESS" in the smpl_config.dat file to the actual address of the devices, is it necessary to create random addresses?
For the interrupt used in the eZ430-RF2500 Sensor Monitor Demo, how can I define the sampling time? For example I want to take 20 samples per second for temperature measurement.
Siti Khairuni Amalina KamarolThank you very much. They are very helpful. In the main_ED.c file of the eZ430-RF2500 Sensor Monitor Demo, there is a part about creating random address. Is that necessary?
No, it is not necessary. You can also remove the following codes for example for the main_ED.c:
/* Check flash for previously stored address */ if(Flash_Addr[0] == 0xFF && Flash_Addr[1] == 0xFF && Flash_Addr[2] == 0xFF && Flash_Addr[3] == 0xFF ) { createRandomAddress(); // Create and store a new random address } /* Read out address from flash */ lAddr.addr[0] = Flash_Addr[0]; lAddr.addr[1] = Flash_Addr[1]; lAddr.addr[2] = Flash_Addr[2]; lAddr.addr[3] = Flash_Addr[3]; /* Tell network stack the device address */ SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, &lAddr);
This will cause the stack to use the default address of the THIS_DEVICE_ADDRESS definition in the .dat file. But be careful that the each node in SimpliciTI network must have unique address, which means you have to change the THIS_DEVICE_ADDRESS defintion each time you compile the code for each node.
Siti Khairuni Amalina Kamarol For the interrupt used in the eZ430-RF2500 Sensor Monitor Demo, how can I define the sampling time? For example I want to take 20 samples per second for temperature measurement.
To do this, basically this part of the code which you have to modified:
/* Initialize TimerA and oscillator */ BCSCTL3 |= LFXT1S_2; // LFXT1 = VLO TACCTL0 = CCIE; // TACCR0 interrupt enabled TACCR0 = 12000; // ~ 1 sec TACTL = TASSEL_1 + MC_1; // ACLK, upmode
It uses Timer_A CCR0 interrupt to generate interrupt after 12000 VLO clock cycles (assuming VLO is 12 kHz). However since VLO is by nature a very unprecised clock source, the period might differ between devices.
More information can be found in the MSP430x2xx Family Users Guide:
http://www.ti.com/lit/ug/slau144i/slau144i.pdf
- chapter 5 about VLO
- chapter 12 about Timer_A.
-Leo-
Hi, thank you so much. By the way, I am using cc2510 DK. And the format to initialize n set the interrupt must be different from the one u gave me. Can u give an example for setting the sampling frequency for the ADC on CC2510?
sorry to miss that you are using CC2510. I am not really familiar with CC2510 as i am with MSP430, but i think there is example codes which you can download here:
http://www.ti.com/litv/zip/swrc117
I found an example code t1_free.c which should do pretty much what you need.
Hi, thanks for your help. I can't open the link you gave me.
sorry for the link. it is fixed now.
I am using SMARTRF Packet Sniffer to capture the packets. How can I extract data from Packet Sniffer?