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.

IAR C libraries for CC2530

Other Parts Discussed in Thread: CC2530, SIMPLICITI, Z-STACK, TIMAC

Hello,

I recently started working with the CC2530 dev kit and began simple C programming using IAR Embedded Workbench. I am wondering if there exist some C libraries or functions that can be used for easy implementations of Timers, UARTs, sending and receiving RF packets from one RF module to another, etc. Where can I get some information or reference regarding these? Thank you

  • JC,

    There are several options for the CC2530 part.  You could try the SimpliciTI stack available here http://focus.ti.com/docs/toolsw/folders/print/simpliciti.html

    You could also try the TI MAC 802.15.4 communications stack available here http://focus.ti.com/docs/toolsw/folders/print/timac.html

    You could also try TI's Zigbee implementation stack called Z-Stack located here http://focus.ti.com/docs/toolsw/folders/print/z-stack.html

    All of these will provide you the capability to communicate over the radio and also will provide you some code to operate some of the peripherals (depending upon which stack you choose).  The stacks are listed in order of complexity in general.

    Regards,

    Jim

     

  • I don't know what to choose between the software stacks and I don't know if I even need them. I need to control some specific microcontroller peripherals like UART, SPI, DMA, MAC timer, etc and I assume if I use the software stacks mentioned above, it will present some hardware abstraction and will be difficult to use the peripherals. My application also needs precise timing between events and large layer of abstraction would not help.

    Can you help me on what software stack would I use? I wonder if I can I still control the radio module and perform radio communication even without using the stacks. Thanks

  • JC,

    If your timing is as tight as you imply, then you are probably correct in that the suggested stacks will have difficulty achieving your goals.  However, note that all of the listed stacks are available in source code so you can use the code at various layers to achieve your goal.  I would suggest starting with the SimpliciTI stack and taking a look at the MRFI_Transmit function in mrfi_radio.c for a general implementation of sending data over the radio.  You can also look at the MRFI_Init to see about setting up the radio for receive using an ISR.

    Any of the stacks will have similar functionality.  This will get you a long way towards controlling the radio.  You may also want to take a look at this appnote for setting up the radio using SmartRF Studio http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=swra352

    For operating the timers, DMA, and other peripherals, you may want to consult the code in the Z-Stack as it utilizes more of these peripherals than SimpliciTI does.

    Jim

     

  • Thanks Jim. I'll try looking at mrfi_radio.c.

    I also looked on codes of the PER test in CC2530 Software Examples. It uses "basic_rf.h" as a header for RF comms and other headers like "hal_rf.h", "hal_timer_32k.h",  "hal_led.h". Is it from the software stacks or is it just made for that application? I would also want to know where to find more information about that HAL headers and how to use it. Thanks in advance.

    JC

  • JC,

    The Z-Stack and TIMAC both use a common HAL library.  SimpliciTI uses a BSP library.  Some of the example code on the web uses a HAL library that is different from that found in the Z-Stack and TIMAC.  There may be more depending on where the library originated.  They will all do approximately the same thing (for those commonly implemented blocks) but there will be small differences so they may not be totally compatible.  That said, they should provide very similar API's and combining them may be easier than writing your own entirely.

    JIm