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.

Timer capture mode interrupt preemption

Other Parts Discussed in Thread: CC430F5137

HI there,

I'm using cc430 TimerA0 to capture a external 10MHz signal. I'm using TA0CCR2 input with 16KHz ACLK and TA0CCR3 input with 135KHz INCLK.

I incresed the MCLK to 10MHz to capture the 135KHz interrupt.

It seems like the 135KHz capture interrupt will preempt the 16KHz, I'm not geting correct capture from either TA0CCR2 or TA0CCR3. 

How can I solve this problem or make the two interrupts work in turn?

Thanks in advance,

Bob

  • Hello Bob,

    This maybe an issue of interrupt priority here. Can you double check which CCR belongs to which timer? In order to have separate time bases, you need to use two different timers. TimerA0 cannot be clocked by a 16kHz ACLK and a 135kHZ INCLK. You could have TimerA0 clocked by ACLK and have Timer A1 clocked by INCLK. Please see the Timer_A Block Diagram found in the User Guide for more information. It is located at the beginning of the Timer_A section.
  • Thank you Jace. According to your reply I think I will separate them to two timers. Previously I have another capture service on the other TimerA1, I will double check to see if I can rearrange them.

    Regards,
    Bob
  • I double checked and I met another issue... When I source the external clk to port2pin2(for instance) and map this port as TA0CLK, this port cannot be assigned as TA1CLK. How can I solve this in software?

    My setting is:
    TA0: TA0CLK, TA0CCR3:GDOCLK
    TA1: TA1CLK, TA0CCR2: ACLK
    Here TA0 and TA1 should both be clocked from external clk.
  • Hello Bob,

    I cannot help any further without knowing which MSP430 you are using. Each Timer has its own INCLK that map out to different pins (TAOCLK, TA1CLCK, TB0CLK, etc.). Depending on the device and/or package of the device you are using, not all Timer INCLCKs maybe pinned out.

    In your above scenario, you would need to separate pins for different Timer external clock inputs. their si no way to fix it in software as they are direct hardware connection to the clocking of their respective Timer. In your above configuration you have TA0 clocked from external clock and TA1 clocked from internal ACLK which is fine.

  • I'm using cc430F5137. The INCLK for TimerA0 and TimerA1 for this chip is pinned from the RF transceiver crystal(RFCLK/192). The following is the signal connection from the datasheet: To be clearer, my scenario is: The input of TimerA0 is TACLK(PM_TA0CLK), the input of TA0CCR3 is GDO1from radio.

    The input of TimerA1 is TACLK(PM_TA1CLK), the input of TA0CCR2 is ACLK.

    The application of this scenario is using GDO1 and ACLK to capture the external CLK, where the frequency of GDO1 and ACLK can be measured with respect to the external CLK. As you explained, now I have to spearate the input pin of external CLK for each timer to solve this situation.  

  • Bob,

    Thanks for the clarification here. I now have a better grasp to what you are trying to do . My only additional feedback here is that if you want to relate Aclck to the input to TimerA1, you need to use a TA1CCRx, not a TA0CCRx.
  • Why ACLK cannot be the input to TA0CCRx? I didn't get this information from the datasheet.

    Another thing I need help from you is, how can I improve the capture accuracy of the timers? From the data I got I found I missed capturing a lot of rising edges in 320 capture interrupt cycles.
  • Bob,

    As seen above Aclck can be an input of TA0CCR2. TA0CCR2 is no way connected or related to TimerA1 for it is a different timer instance. If you want to relate ACLK to the external input you have for TimerA1, you need to use a TA1CCRx that supports ACLK input. 

**Attention** This is a public forum