Hey,
i would like to make an IR communication system which has a transmitter-receiver on both sides. When i try to send my signal , 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?
Here is my try but it doesn't work. (i'm sorry i don't know how to insert code)
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{ P2IE &=~BIT0; //disable receiver
if((P1IN&BIT7)!=BIT7) {
(transmit part)
P2IE = BIT0; //enable interrupt
P2IES= BIT1; // enable falling edge
P1IFG &= 0x00; // clear port 1 interrupt flag
}
}
i would like to make an IR communication system which has a transmitter-receiver on both sides. When i try to send my signal , 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?
Here is my try but it doesn't work. (i'm sorry i don't know how to insert code)
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{ P2IE &=~BIT0; //disable receiver
if((P1IN&BIT7)!=BIT7) {
(transmit part)
P2IE = BIT0; //enable interrupt
P2IES= BIT1; // enable falling edge
P1IFG &= 0x00; // clear port 1 interrupt flag
}
}