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.

Using Timer B in eZ430-RF2500

Other Parts Discussed in Thread: CC2500

hi everyone,

I'm using ez430-RF2500, I'd like to use Timer_B inside End point card. But I didn't know how to use it.

I would like to put a procedure inside the Timer_B interruption.

Please Can any one give me an idea.

 

 

  • Sami NEMER said:

    I'm using ez430-RF2500, I'd like to use Timer_B inside End point card. But I didn't know how to use it.

    I would like to put a procedure inside the Timer_B interruption.

    Assuming you are using the SLAC139 Wireless Sensor demo as the base, I would suggest modifying the demo_ED.c in the main() to configure and enable the Timer B peripheral.  You should review the MSP430x2xx Family User's Guide (SLAU144) for information on the configuration of the Timer B.

    The following code snip is an example to add to demo_ED.c to create the interrupt service routine for Timer B.

    /*------------------------------------------------------------------------------
    * Timer B0 interrupt service routine
    ------------------------------------------------------------------------------*/
    #pragma vector=TIMERB0_VECTOR
    __interrupt void Timer_B (void)
    {
      /* add your code */
      __bic_SR_register_on_exit(LPM3_bits);        // Clear LPM3 bit from 0(SR)
    }

  • Thanks for informations about  TimerB, but I still have problem.

    The problem is that the EndDevice stop sending message to Access point and also doesn't make .

    In the main() (indside demo_ED.c) just after the configuration of TimerA,I configured the TimerB like this :

                   TBCCTL0 = CCIE;                           // TBCCR0 interrupt enabled
                   TBCCR0 =  6000;
                   TBCTL = TBSSEL_2 + MC_1+TBIE;                  // SMCLK, upmode, interrupt

    and inside the interrupt service routine I've done like this:

    #pragma vector=TIMERB0_VECTOR
    __interrupt void Timer_B (void)
    {
        P4DIR|=0x38 ;    //  |"00111000"
        P3DIR|=0x0F;        // | "00001111"

        P3OUT=P3OUT | 0x0F  ; // P3OUT | "00000100"

        P4OUT=P4OUT | 0x48  ; // P4OUT | "01001000"

        for(volatile int i = 0; i < 0x0304; i++){}   
        P3OUT=P3OUT & 0x00; // P3OUT & "OOOOOOOO"
        P4OUT=P4OUT & 0x00; // P4OUT & "OOOOOOOO"
        for(volatile int i = 0; i < 0x0704; i++){}

    __bic_SR_register_on_exit(LPM3_bits);        // Clear LPM3 bit from 0(SR) 

    }

    It seems that END Device Can't join, Also the routine" linkTo()" ;  isn't  executed.

    Can you please tell me what's the problem and how can I solve it?


  • In your Timer_B() interrupt service routine you are modifying the settings of Port 3 which is also connected to the CC2500 radio.  P3.3 downto to P3.0 are used for the SPI interface to the CC2500.
    This would explain why your communications with the AP are not working.  Please refer to the schematics of the eZ430-RF2500 kit in the eZ430-RF2500 Development Tool User's Guide (SLAU227) to see how these connections are made.

  • Think you for your help,

    So it's impossible to use P3.4 downto P3.0. And what about GDO2 and GDO0 which they are connected to P2.0 & P2.1, It's possible to use them?

    In other side, can you please tell me about the relation between (TACCR0 = 12000) and 1 sec, how it was calculated?

    Think you a lot for your time.

    Regards