Matthew Grenke

13192-EVB Board - Zigbee applications

Discussion created by Matthew Grenke on Aug 10, 2011
Latest reply on Sep 2, 2011 by Matthew Grenke

Hi there,

 

I have a 13192-EVB board that uses a MC9S08GT60 MCU. I have some code that works on this board to get temperature readings from a DS1822 digital temperature sensor. I am now trying to transmit this information wirelessly to another 13192-EVB or 13192-SARD board. I am just looking for some general information on the options I have available to accomplish this. I have already tried to use an sample Zigbee application and modify it to transmit the temperature information but it doesn't seem to work. I may have to use another sample program which generates an interrupt when the temperature conversion is done and then transmits the data at that time. I was reading over the Beestack Application Development Guide and the example in there is similar it seems. It uses the onboard accelerometer data and when the result is available from the A/D converter it then transmits the data using Zigbee. This is very similar to what I want to do except the temperature sensor is a digital one so I'm not using the A/D converter unit. I have tried to modify the smac-per-tx application for this purpose but it doesn't seem to be working. When I transmit to the other board I get all zero's for some reason. When I manually input a value to transmit such as 26, the value shows up fine on the other end. I will post my code here and perhaps people can take a look at it and give me an idea of where I may have gone wrong. I have also shown the part of the code where the transmitting is happening and where I try to call my temperature function to transmit the result. Thanks for your help.

 

switch (app_status) {   case INITIAL_STATE:  //Walk the LEDs    //For TX    LED1 = LED_OFF;  //Turn off all LEDs    LED2 = LED_OFF;    LED3 = LED_OFF;    LED4 = LED_OFF;        LED1 = LED_ON;         //Lights LED1    for (loop = 0; loop < LED_DELAY; loop++);      LED1 = LED_OFF; LED2 = LED_ON;     //Lights LED2, Turns off LED1    for (loop = 0; loop < LED_DELAY; loop++);    LED2 = LED_OFF; LED3 = LED_ON;     //Lights LED3, Turns off LED2    for (loop = 0; loop < LED_DELAY; loop++);    LED3 = LED_OFF; LED4 = LED_ON;     //Lights LED4, Turns off LED3    for (loop = 0; loop < LED_DELAY; loop++);    LED4 = LED_OFF;         //Turns off LED4    LED1 = LED_ON;     app_status = IDLE_STATE; //Switch app status to TX_STATE            temp=Temperature();                       tx_data_buffer[0] = 0;         tx_data_buffer[1] = temp;         tx_data_buffer[2] = temp;         tx_data_buffer[3] = temp;         tx_data_buffer[4] = temp;                    tx_data_buffer[5] = temp;                              tx_data_buffer[6] = temp;                              tx_data_buffer[7] = temp;                              tx_data_buffer[8] = temp;                              tx_data_buffer[9] = temp;               tx_packet.u8DataLength = 10; //Set the data length of the packet.  in this case, 6.        packet_count=0;    break;

 

          /* See if START TX has been hit */               if ((gu16Events & KBI2_EVENT) != 0) {            #if BUZZER_ENABLED               BUZZER = BUZZER_ON;            #endif               delay(10);            #if BUZZER_ENABLED               BUZZER = BUZZER_OFF;            #endif               gu16Events &= ~KBI2_EVENT; /* Clear the event */               packet_count=0;               setLedsMode(LED_DIGIT_MODE, (UINT16) 8421, 10, LED_NO_FLAGS);                            temp=Temperature();                                           tx_data_buffer[0] = 0;         tx_data_buffer[1] = temp;         tx_data_buffer[2] = temp;         tx_data_buffer[3] = temp;         tx_data_buffer[4] = temp;                              tx_data_buffer[5] = temp;                              tx_data_buffer[6] = temp;                              tx_data_buffer[7] = temp;                              tx_data_buffer[8] = temp;                              tx_data_buffer[9] = temp;                                  //Set the data length of the packet.  in this case, 6.       tx_packet.u8DataLength = 10;       packet_count=0;               app_status = TX_STATE;        }

 

I just wanted to mention as well that each Zigbee packet in this case is 10 bytes(modified from the original 18) and it requires that I transmit a '0' to begin. This is why every transmission starts with a zero and then I transmit the temperature information 9 times after that. I should also mention that it is not necessary for me to use the smac_per_tx application to transmit the DS1822 temperature information. If you know of a simpler zigbee application that I could use, I would gladly use that as well. I am basically looking for the simplest way to take the data from the DS1822 and transmit it via Zigbee to another 13192 EVB-board. The number of transmissions I require is not more than 10 measurements per day for example but more measurements would not be a bad thing if that is easier to implement. I suspect it is the same difficulty to implement 10 measurements or greater than 10.

Outcomes