How to disable port 2 interrupt when port 1 interrupt is active

Thread Starter

ali ahmet

Joined Apr 30, 2019
3
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
}

}
 

BobTPH

Joined Jun 5, 2013
11,514
When i try to send my signal , receiver on the opposite can't capture my signal sometimes because my receiver captures it.
I cannot understand what you mean by this. If the signal is sent out, how can your device seeing it affect how another device sees it? This is like saying I turned on a light and my collegue standing next to me can’t see it because my eyes saw it.

Bob
 
Last edited:
Top