Maker Pro
Maker Pro

interrupt of 8051

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Hello!!!!!!!!!

I am using interrupts of p89v51rd2 and the signal which i am getting as an input is active high.

I have not used the NOT gate in between.

Is there any alternative to get it done?

Thanks,
paddy
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,613
Joined
Nov 17, 2011
Messages
12,613
I'm not familiar with this chip. Where's the problem?
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
this is similar to 8051.

The interrupts are active low enable and the signal which i am receiving is active high.

And i have not placed the NOT gate between received signal and interrupt pin of micro controller.

Because of that interrupt routine is not working.

Thanks,
paddy
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,613
Joined
Nov 17, 2011
Messages
12,613
Then why don't you insert the inverter? I don't see a way around this.
If you don't have a spare gate in your circuit, a simple 1-transistor common emitter circuit can invert the signal (see here, bottom of the page).
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
thank you for your suggestion.

I have used transistor to invert the signal and now it is working fine.

I am facing a problem of noise.

Even if in the absence of the signal the alarms are generating. And this happens only when there is a switching.

Please suggest how to get rid of it.

thanks,
paddy
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,613
Joined
Nov 17, 2011
Messages
12,613
And this happens only when there is a switching.
Where and what is switching?

You may try and add a resistor from the base of the NPN transistor to GND. The value should be approx. 1*Rb. Also a small capacitor (100pF) from the base o GND can help.
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
The system is working on 24V DC supply which is given through power supply and 230V to the power supply is given through Mains.

So if i turn on/off any other devices which are working on mains supply, the systems starts generating alarms.
 
Last edited:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,613
Joined
Nov 17, 2011
Messages
12,613
Then you should provide a better filtered power supply.
At the very least you need to filter the power supply pins of the microcontroller (and other chips) in your circuit. Typically a 100nF capacitor very close to the VCC/GND pins of each IC is a standard filter procedure.

Harald
 

paddy

Sep 11, 2012
81
Joined
Sep 11, 2012
Messages
81
Yes it worked!!!!

A capacitor in between base and ground.

Thank you for support!!!!!
 
Top