0
\$\begingroup\$

I am using MSP430G2553 with IAR.

I would like to make an IR communication system which has a transmitter-receiver on both sides. When I try to send my signal, the receiver on the opposite can't capture my signal sometimes because my receiver captures it. I don't know to when i should disable and re-enable it?

#pragma vector=PORT1_VECTOR 
_interrupt void Port_1(void)
{
    P2IE &=~BIT0; //disable receiver 

    if((P1IN&BIT7)!=BIT7) {
        (transmit part)
        P2IE = BIT0; //enable  interrupt for receiver
        P2IES= BIT0; // enable falling edge 
        P1IFG &= 0x00; // clear port 1 interrupt flag
    }
}
\$\endgroup\$
  • \$\begingroup\$ You do not say what platform this is for. This sort of stuff is both hardware- and toolchain-specific (or at least toolchain-specific if this is some cross-platform toolchain). \$\endgroup\$ – TimWescott May 4 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.