This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Simple ZASA

Other Parts Discussed in Thread: MSP430F2274

I am new to msp430, and I have to admit that although I worked with C on a few occasions, I am not an experienced C programmer.

 

I would like to setup the simplest Zigbee network for my ez430-rf2480,

just a coordinator and one endpoint. (maybe add a second endpoint later on)

 

I would like to use ZASA example, and strip it to the barebone as much as possible while keeping reliable operation of the network.

 

I would like to use hyperterminal as PC application, and TI USB dongle as Virtual Com. Port.

My host application’s priority is to sense  a few bits on its digital I/O and transmit these as bytes to coordinator when certain number of bytes has been read, instead of every 10 seconds. Host msp430f2274 should not miss any samples. The received bytes then need to be output to hyperterminal.

 

1)      I am confused regarding the MT.                                                                           Do the MT_HOST and MT_xxxxx functions serve to transmit and receive data between my PC application through dongle on one side, and cc2480 radio on the other side (via f2274’s tx and rx, pins 3.4 and 3.5)  or what exactly would I use the MT for ?

2)      Do I have to have target boards setup as Sources and Sinks ?

What if I need to send data both ways between source and sink, how would I need to handle that ?

3)      Can you please help me with what I can get rid of in ZASA, as well as what absolutely needs to be there, and how I need to modify the code (no button actions, using fixed addresses etc.) ?

4)      I also need to reprogram the boards using IAR.

Should same code be programmed to both target boards, coordinator and endpoint alike ?

5) There is a note in one of the host application functions (temperature measurements

     as I recall) saying not enough memory.                                                    

           Does that refer to RAM or to IAR 4k limit or something else ?

 

 I would much appreciate any help,

Thanks !

  • Hi Alex,

    The MT folder is related to the Hyperterminal MSP interface. All that the MSP recives through air is sent to the hyperteminal through the MT related codes. mtTx transmits dats to the hyperterminal. So you might want to code this to display in human redable format.

    As for two way communication, please refer to existing posts. This topic has already been extensively discussed across other posts

    Cheers

    Kaushik

  • Normal 0

    Apparently, I have not found what I was looking for in the search.

    Since this has been discussed, can you point me toward the link to answer to my question 5?

    (I should have said not enough code space rather than memory, to be exact)

    In Sample_app.c, appSrceData function :

    case appTempF:  // Measuring air temperature.

        appFlags &= ~appTempF;

       // oC = ((A10/1024)*1500mV)-986mV)*1/3.55mV = A10*423/1024 - 278

        srceReport[SRCE_REPORT_TEMP] = ((halAdcVal - 673) * 423) / 1024;

        /* TBD: not enough code space: if (tempOffset != 0xFFFF)

        {

          srceReport[SRCE_REPORT_TEMP] += tempOffset / 10;

        }*/

     

    In Hal_board.c :

    void halDelay(uint8 msecs, uint8 sleep)

    {

      // Expected scaling for msecs is 3/2, but depends on result of TimerA calibration.

      // TBD - not enough code space: uint16 stop = msecs * (TACCR0_INIT / 10) / (1000 / 10);

     

    TBD ? Are you kidding me ?

     

    Sorry about the attitude but I just love spending money and getting stuff  TBD.

     

    Anyway, I would appreciate if anyone can explain.

    Thanks.

  • The ZigBee Accelerator Sample Application  (ZASA) example is just that, an example.  And yes, I believe it was running into an issue of hitting the 4K IAR Kickstart limit.

  • If you add 1 byte of code to the ZASA app, the Kickstart compiler will complain the code size is too big.

    Do not use HyperTerminal!!  It loses data if you send data too fast.

    sample_app.c contains the core logic for the ZASA application.  Everything else you can treat as library support.

    I think you are best off writing your own sample_app.c and completely discarding the ZASA file.  You should study how sample_app.c uses halTimerSet and halEventFlags as this is useful to keep.  You should use the AF API instead of the Simple API, because the Simple API is not really any simpler and omits some data that you may find useful.

    I had issues with halTimerDelay and thus changed this and the TimerA code.  Note that halTimerDelay works when interrupts are not enabled.  If you change it, to depend upon interrupts like I did, then some things break(I think SPI comm).

    I would create a #define const to define the device type(Coordinator, Router, EndDevice).  You can use this constant to control the code you write.  Our boards have a dipswitch that we can read for this purpose.