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.

MSP430FR2355: timer B0 capture compare 1 or 2??

Part Number: MSP430FR2355

When I use timer b0, b1 or b2 and capture compare register 0 I can configure registers and all works as expected.  When I change the capture compare registers to 1 or 2 on ANY of the three timers my source clock TBxR never runs.  I have verified that in all instances I have the appropriate settings in the appropriate registers.  Is there something different with respect to getting the timer to run when using a CCR other than 0?

Thanks

  • You probably need to offer a concrete example.

    Up mode always uses CCR0. You can't use any of the other CCRs for this. If CCR0==0 (in Up mode)  TBxR will always be ==0 (it counts to 0, then resets to, um, 0).

    Do you have a code fragment you could post?

    [Edit: The FR59 User Guide (SLAU367P), Sec 26.2.2 says that the (TB) timer doesn't count when CCR0==0 in Up mode. I don't see this statement in the FR2 User Guide (SLAU445I), but I find it hard to believe the two implementations are that different. This is a subtle distinction, and I expect it doesn't make any difference to you.]

  • I looked at the user guide and saw that as well.  I implemented TIFG within the ISR bcz I thought that in up mode that may work...I will look closer at the user guide tomorrow to see if continuous mode or up down mode allow ccr1 or 2...

    I don't have a small code snippet at the moment....hoping it doesn't come to that

    Thanks

  • Up/Down mode also uses CCR0. Continuous mode doesn't use any CCR for bounds, it just runs until it overflows. You have some (limited) control over the Continuous mode bound by changing the bit-width of the counter (TB0CTL:CNTL).

    Is there something you're trying to accomplish by switching the CCR? Maybe there's another way to do it.

  • I can work with all you've said, just trying to understand the playing field. 

    So is it safe to say that CCR1 and CCR2 are available to use ONCE CCR0 has been loaded with a value? Independent of whether or not you've enabled CCIE for CCR0?

  • For Compare+Up mode, that's about right. In many applications there's no need to enable CCTL0:CCIE at all. 

    If you don't want to have a B0 (CCR0) ISR, you can use TAIE instead of TB0CCTL0:CCIE and do all your work in the B1 ISR. The two interrupts (TAIFG and CCTL0:CCIFG) happen at almost the same time -- the difference rarely matters.

**Attention** This is a public forum