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.

External Interrupt in AVR

Status
Not open for further replies.

movie_freak

Member level 5
Joined
Mar 20, 2007
Messages
89
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,943
avr external interrupt

Hi,

I am doing this


Code:
DDRE &= ~(1<<4);
                SREG &= ~(1<<7);
		/* Initialize external interrupt on PE4 */ 
		EIMSK  |= (1<<INT4);
   		EICRB |= (1<<ISC40);    // For any logical change the interrupt triggers
		SREG |= (1<<7);
catching it with:

Code:
ISR(INT4_vect)
 {
       // Here i do anything
 }

In the hardware i am having the sensing connected to the controller through a resistor.

Its an ATmega. The input being sensed is 12V(high) DC or 0V(low) DC


The issue: This pin is so vunerable that even if we touch it with hand, or a tweser it executes the "INT4_vect interrupt.

So how can i stabilize this?


Many Thanks,
Surya
 

avr external interrupts

use low pass filer and a schmitt trigger

Nandhu
 

external interrupts avr

Thanks Nandhu,

I made a scmitt trigger with lm324, but it didnot solve my problem? I did not use a low pass filter though.

Actually, im not good in this.. , so i wanna ask you if i need to add the low pass filter after the scmitt trigger or before it?

The problem is still the same: the external interrupt executes even if we touch the pin or connecting wire, it's so vulnerable that if we connect a wire and leave it open and move our hand near the wire the interrupt executes.. :?: ..(the output of scmitt trigger is now 2.9 V or 0V but still the issue persists ) and i want it to stabilize?


Many Thanks,
Surya
 

external interrupt avr

Hai

Can u post the schematic

there must be a problem with your hardware i think,

If possible please post the hole code, This will help me to point out the exact problem easily

Regards
Nandhu
 

external interrupt with avr

This is the circuit i have made[/img]
 

interrupt in avr

Above schematic is comparator with hysteresis, I think u must use OP-Amp that specifically used as comparator like LM393.
But you must first try to use RL at the input of Micro controller to ground (ex. 1 K).
But, I have see abnormal at your schematic, your MC using 5 V DC, but your comparator using 12V DC, I think it is influence to the system.

regards,
-Imam-
 

avr input 12v

But you must first try to use RL at the input of Micro controller to ground (ex. 1 K).

I just forgot to show in the diagram there is a 10k between the input of controller and ground


I hope lm324 may also serve as the op-amp required for this application, and hysteresis is added in the process of resolving the issue to remove the vulnerability

But, I have see abnormal at your schematic, your MC using 5 V DC, but your comparator using 12V DC, I think it is influence to the system.
I also did not get what's abnormal in using the controller on 5V DC and the comparator to compare a 12V signal?? Can you elucidate it?


Thanks,
Surya
 

avr interupt pull up

movie_freak said:
But you must first try to use RL at the input of Micro controller to ground (ex. 1 K).

I just forgot to show in the diagram there is a 10k between the input of controller and ground


I hope lm324 may also serve as the op-amp required for this application, and hysteresis is added in the process of resolving the issue to remove the vulnerability

But, I have see abnormal at your schematic, your MC using 5 V DC, but your comparator using 12V DC, I think it is influence to the system.
I also did not get what's abnormal in using the controller on 5V DC and the comparator to compare a 12V signal?? Can you elucidate it?


Thanks,
Surya

if u use LM324, when this op-am (as comparator) output as high, it will generate +VCC in output, so if you use 12 VDC in your comparator, when it generate high output it will give + 12V to Microcontroller input, I think it will damage microcontroller logic. If u use LM 339 it use open collector output when high state. So, I think it will better, and u can use Resisstor pull up 5 V.
Have you try to another schematic?, I think you must try this schematic (at attachment)

regards,
-Imam-
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top