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.
Hi,
i tried to test the Timer B capture interrupt (@ msp430f5529) but no interrupt was released.
I wanted to relase an interrupt by a positve edge at P5.6/TB0.0 -> CCR0 capture: CCI0A input.
So i configured the Timer B as follows(my complete test-program):
#include <msp430x552x.h>
void main(void){
WDTCTL = WDTPW + WDTHOLD;
P5SEL |= BIT6; // Option select: P5.6 -> TB0 CCI0A
TB0CCTL0 |= CM_1 + CCIS_0 + CAP + CCIE; // pos. edge + CCIXA + capture mode + Interrupt enable
TB0CTL = TBSSEL_1 + MC_2; // Timer B: ACLK + continous up
while(1){
_NOP();
_BIS_SR(LPM0_bits + GIE);
}
}
#pragma vector=TIMER0_B0_VECTOR
__interrupt void TIMER0_B0_VECTOR_ISR (void){
TB0CCTL0 &= ~CCIFG;
_NOP(); // Set breakpoint here
}
I have no idea why nothings happen if i do a positvie edge at P5.6...
Did i some mistakes or forgot something to configure?
Thanks for replies
Krapser
Hi Krapser,
The code looks pretty good. For style I would change "TB0CCTL0 |= " to "TB0CCTL0 = ", but that isn't likely to be the problem.
Are you using the dev kit or your own board? How are you generating your positive edge? Maybe look elsewhere since the code looks good.
Jeff
Did you pull it low before applying the positive edge? A floating pin that is applied VCC and then nothing, probably won't cause a level change and therefore no edge detect interrupt.
by default, the pins are (unlike TTL pins) high-impedance and there is no internal pullup. So if you pull the pin low and then release it, it will stay low due to parasitic capacitance for a long time and not immediately (if at all) turn to high state. You need to activat ethe internal pullup (or pulldown) or apply VCC and GND to the pin to generate edge interrupts.
**Attention** This is a public forum