Hi,I'm trying to use port P2.1 of the 2553 as capture input port for timer1. My problem is, that the interrupt dervice routine is never called. Any hint what I'm doing wrong here ?
Maybe it's being called just once, and then:
TA1CCTL1 = ~CCIE;
messes up the configuration of the capture by selecting Vcc instead of CCIxA.
I think you meant
TA1CCTL1 &= ~CCIE; // (and is it CCIFG that you meant?)
Also you should watch out for over-using "|=" in your configuration of TA1CTL and TA1CCTL1. Just use simple assignment statements "=" instead.
Jeff
Hi Jeff,first of all thx for your fast response:
>>Maybe it's being called just once, and then:
>>TA1CCTL1 = ~CCIE;
>>messes up the configuration of the capture by selecting Vcc instead of CCIxA.
>>I think you meant
>>TA1CCTL1 &= ~CCIE; // (and is it CCIFG that you meant?)
Yes - that's what I meant :-) But the problem is that the interrupt service routine is not called even once.
I have a display connected to the msp430 and it never gets over the line:
__bis_SR_register(CPUOFF + GIE);
so that
LCDSetPosition(1,8);
itoa(temp,string,10);
LCDPrintString(string);
gets executed.
>>Also you should watch out for over-using "|=" in your configuration of TA1CTL and TA1CCTL1. Just use simple assignment statements "=" instead.
Yep - you are right
Any other idea's ??
P.S. If anybody needs a Pac Man bitmap for their LCD display - it's included in the source I attached :-)
Not sure how your serial device works, but there is a conflict between your comment "falling edge" and your code "CM_1".
CM_1 is for capturing rising edges.
Jeff Tenney Not sure how your serial device works, but there is a conflict between your comment "falling edge" and your code "CM_1". CM_1 is for capturing rising edges. Jeff
This is only because the code is driving me nuts for more than 3 days now :-)
Testing different settings ....
I have a CMOS NE555 with 8Hz and 50% duty cycle connected to port 2.1
So in theory it should reach the interrupt service routine no mather wheter I
trigger on - the rising or falling edge ...
Thorsten Lauerdriving me nuts for more than 3 days now :-)
No fun. Sorry to hear that.
Can you try something for me?
Just for testing purposes, replace this:
__bis_SR_register(CPUOFF + GIE); // Enter LPM0, enable interrupts
with this:
while (P2IN & TACHO) { // do nothing. Just wait. } while ( (P2IN & TACHO) == 0) { // do nothing. Just wait. }
Then see if it runs. If it doesn't run, you should be able to see where it is getting stuck.
Thorsten LauerYes - that's what I meant
I don't see what else could be wrong. The only thing I can imagine is that the initialization of the LCD somehow undoes the configuration of your port pins (especially clearing the P2SEL that enables the capture input)
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
Jens-Michael Gross I don't see what else could be wrong. The only thing I can imagine is that the initialization of the LCD somehow undoes the configuration of your port pins (especially clearing the P2SEL that enables the capture input)
P2SEL = 0;P2SEL2 = 0;
with
P2SEL &= ~(LCD_PIN_RS + LCD_PIN_EN);
P2SEL2 &= ~(LCD_PIN_RS + LCD_PIN_EN);
it's working now.
Special thanks also to Jeff Tenney, who also tried to help.