Hi,I having problem with decoding the received IR signal from the normal 38 Khz remote and I am using the 38Khz receiver from the vishay. I am using the capture & compare timer of the msp430g2253.but the problem I am facing is in my code below is it can capture the falling edge and produce the interrupt but when I change capture mode to capture rising edge it doesnt detect the rising edge and remains in the low power mode.another problem with this code is that after getting the first falling edge interrupt it remains in the sleep mode only though I am clearing the cpuoff bit in the ISR. Please help me I have hit the wall and provide any code which can caputure both rising edge and falling edge and at the same time it should save the CCR value so that I can have the timing between falling and rising edge. please it is for the project.Your help is appreciated.
my code is as below.it doesnt execute the colored part and remains in the sleep mode.
#include "io430.h"
unsigned int rxdata = 0; // received data: A4-A0 and C6-C0 0000 AAAA ACCC CCCC
unsigned int bitCounter = 0;
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // stop WDT
BCSCTL1 = CALBC1_1MHZ; // load calibrated data
DCOCTL = CALDCO_1MHZ;
P1DIR &= ~BIT1; // P1.1 input
P1SEL = BIT1; // P1.1 Timer_A CCI0A
P1OUT &= ~(BIT0 + BIT6 + BIT5); // P1.3-1.5 out
P1DIR |= (BIT0 + BIT6 + BIT5);
TACTL = TASSEL_2 | MC_2; // SMCLK, continuous mode
CCTL0 = CM_2 | CCIS_0 | CAP | CCIE; // falling edge capture mode, CCI0A, enable IE
__bis_SR_register(CPUOFF + GIE);
rxdata = CCR0;
CCTL0 = CM_1 | CCIS_0 | CAP | CCIE;
__bis_SR_register(CPUOFF + GIE);
bitCounter = CCR0;
}
#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
{
__bic_SR_register(GIE);
P1OUT = P1OUT ^ BIT0;
TACCTL0 &= ~CCIFG;
__bic_SR_register(CPUOFF);
}