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.

how do i add ten seconds delay before acceleration measurement is passed to RF USB Access point?

Hi,

 

I need to add a time delay of ten seconds before passing the measurement to the RF Access point. How do i do that?

 

Algorithm:

Measure acceleration,

Delay for 10 seconds,

Transmit acceleration to RF USB Access point,

After 10 seconds, Acceleration measured is displayed on TI Chronos Control Centre

 

Thanks,

Jeremy

  • jeremy,

     

    There are a few of different ways to do it:

    1.  __delay_cycles(x);  whrere x is the number of clock cycles to wait. experiment with it.

    2. you can use an empty for loop to loop until you would like to continue: i.e for(x=0 ; x<itterations; x++) . itterations is the number of times you would lilke to loop.

     

     

    I would reccommend option one. Based on your clock frequency you should be able to calculate how many cycles is needed for a 10 sec delay.

  • What I've done in projects where there was a 32KHz crystal connected to XT1 is to set one of the timers, A or B, to be sourced by ACLK and set the timer to be in count up mode. Set a compare register for 32768.  This is essentially Davids option one.

          TACTL = TASSEL0+TACLR;       // Set timer A to be sourced by ACLK(32KHz)

          TACCR0 = 32767;

          TACTL |= MC_1;                            // Start timer in continuous mode

           while ( !TACCTL0 & CCIFG );    // wait for timer to expire

          // if here, then one second has gone by

     

     

    HTH,

    Barry

**Attention** This is a public forum