Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

On UART input,RB0 interrupt is fired

Status
Not open for further replies.

rahulmr

Junior Member level 1
Joined
Feb 21, 2007
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,434
I am creating a GSM project with GSM input to RX/TX of the PIC16F877A .Also I am using a PIR sensor which outputs 3 v and is connected to RB0 .
INTEDG is set to 1.When an interrupt happens, an LED is made to toggle.

I have a few problems here :

When the RB0 is connected to 5v using a switch, then only when switch is closed, the interrupt is fired and I see the LED toggled. Even when I make some UART interrupts either by making a call or sending SMS nothing happens to the LED.It works perfectly as there is no interrupt happening.


But when this RB0 is connected to the O/p of the PIR sensor, then normally only when a motion is detected the interrupt is fired and LED toggles.
But I face a problem now that when a call or SMS is sent so that UART is activated then the interrupt is fired for the RB0 as well.The PIR sensor is covered by a paper box so as to make sure no movement is detected.

I have noticed the voltage at RB0 at this moment and is 3V now from 0.

I am not sure why when there is UART signals coming in, there is interrupt fired and why the RB0 is set to high from 0 at that time eventhough the PIR is covered to prevent motion detectio.

I have disabled all other interrupts RBIE and timer interrupts as well. I have tried to trigger RB0 on low edge trigger by setting INTEDG=0 also powring RB0 with 5v and on movement detection the voltage drops to 0. But even in this case when UART is interrupted , the RB0 fires and the voltage at RB0 drops from 5V to 0v.


I have tried with 2 microcontrollers hoping the problem is with PIC but it same in each case.

I also tried setting RA0 as input instead of RB0 and in the main while loop checks whether RA0=1. This also works normally and when motion is detected, RA0 is set with 1 and the LED toggles.Here no interrupt logic is used for PIR output. But here as well on UART interruption the RA0 is set to high and LED toggles.


I somehow believe that whatever the case is when the UART is interrupted the LED toggles in the method which is supposed to call only when RA0 or RB0 is set.

I also see when i move my finger aroun the RB pins the interrupt is fired. Is it somekind of noise or something ?
 

Do you have a pulldown on RB0 or PIR has totem-pole output?
i.e if PIR is not fired, is the RB0 pin floating?
 

Do you have a pulldown on RB0 or PIR has totem-pole output?
i.e if PIR is not fired, is the RB0 pin floating?

For the high-low interrupt where I have set INTEDG=0, the RB0 is tied to 5v through 10k resistor.When the interrupt is not there, 5v is what is shown on RB0, and when PIR interrupts, the RB0 comes to 0.

But as mentioned, this RB0 comes to 0 from 5 when the USART interrupts. But when this RB0 connected to a switch mechanism instead of this PIR, for the UART interrupt no RB0 is fired.
 

Is the PIR near the modem? It may triggers the reed relay by noise. Reed relays are too sensitive.
 
Is the PIR near the modem? It may triggers the reed relay by noise. Reed relays are too sensitive.

Yes it is somewhat near to the modem. I will try moving that away.Any other issues could be there ?
 

Thanks and it got resolved as I kept my modem far away from the PIR . And since PIR is isloated its not interfered by the signals. Also any phone signals can make interruption
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top