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.

Export RSSI to hyperterminal

Other Parts Discussed in Thread: CC2430, Z-STACK

Hi, I am using a SmartRF 04EB with CC2430 Evaluation Module. I would like to ask if anyone knows how I can write RSSI on the hyperterminal (instead of the LCD or on the Smart RF Studio)

 

I will need to export it to the hyperterminal and save it be able to save it, thank you very much.

  • Hi,

    There is a Link Quaklity item in the call back MSG, the value of this link quality is calculated out from the value of the RSSIL register in CC2430. The algorith you can find in the implimentation of the Z-Stack. Which is called macRadioComputeLQI()


    if you want to write the value into the HT, then you need to include the hal_uart.h and make the configuration according your need of the stucture halUARTCfg_t halUARTCfg_t then enable the configuration by calling HalUARTOpen(), then you can use hal_uart_write to write the message to the HT.

    Here is some sample code:

    //==========================

        //define the UART structure
        halUARTCfg_t                                 uartConfig;
        uartConfig.baudRate                     =             SERIAL_APP_BAUD;
        uartConfig.flowControl                 =             FALSE;             // CTS/RTS
        uartConfig.flowControlThreshold     =             SERIAL_APP_THRESH;
        uartConfig.rx.maxBufSize            =             SERIAL_APP_RX_MAX;
        uartConfig.tx.maxBufSize                =             SERIAL_APP_TX_MAX;
        HalUARTOpen (SERIAL_APP_PORT, &uartConfig);

    //==========================

    and ofcourse the definition

    //==========================

     //init the uart - DEfine the value of UART
        #if !defined( SERIAL_APP_PORT )
          #define SERIAL_APP_PORT  0
        #endif

        #if !defined( SERIAL_APP_BAUD )
          // CC2430 only allows 38.4k or 115.2k.
          #define SERIAL_APP_BAUD  HAL_UART_BR_38400
          //#define SERIAL_APP_BAUD  HAL_UART_BR_115200
        #endif

        // When the Rx buf space is less than this threshold, invoke the Rx callback.
        #if !defined( SERIAL_APP_THRESH )
          #define SERIAL_APP_THRESH  48
        #endif

        #if !defined( SERIAL_APP_RX_MAX )
          #if (defined( HAL_UART_DMA )) && HAL_UART_DMA
            #define SERIAL_APP_RX_MAX  128
          #else
        /* The generic safe Rx minimum is 48, but if you know your PC App will not
         * continue to send more than a byte after receiving the ~CTS, lower max
         * here and safe min in _hal_uart.c to just 8.
         */
            #define SERIAL_APP_RX_MAX  64
          #endif
        #endif

        #if !defined( SERIAL_APP_TX_MAX )
        #if (defined( HAL_UART_DMA )) && HAL_UART_DMA
          #define SERIAL_APP_TX_MAX  128
          #else
            #define SERIAL_APP_TX_MAX  64
          #endif
        #endif

        // Millisecs of idle time after a byte is received before invoking Rx callback.
        #if !defined( SERIAL_APP_IDLE )
          #define SERIAL_APP_IDLE  6
        #endif

        // This is the desired byte count per OTA message.
        #if !defined( SERIAL_APP_RX_CNT )
          #if (defined( HAL_UART_DMA )) && HAL_UART_DMA
            #define SERIAL_APP_RX_CNT  80
         #else
            #define SERIAL_APP_RX_CNT  6
          #endif
    #endif

    //========================================

     

    BR

     

    Jch

  • can this work while i am doing the PER test? thanks.

  • Hi issaph,

    Not to familiar with the CC2430 PER example, but you will need to add some UART code in your appReceiver() function. Seems like the hal library that comes along have some support for this already. See the hal_uart.h under HAL and Interface in your project.. You will need to make the functions yourself though.

    There is a design note on the UART that you can study here:
    http://focus.ti.com/analog/docs/techdocsabstract.tsp?familyId=936&abstractName=swra222a

    Now if you look at the appReceiver() function you will need to see which of the RSSI is of interrest to you. The PER example uses a ring buffer to calculate the average RSSI over RSSI_AVG_WINDOW_SIZE samples. It is this rxStats.rssiSum which is written to the LCD: If you want the raw RSSI you will need to use the loca rssi variable.

    Rgds,
    Kjetil