Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Strangest thing: INT0 generates Reset and handling INT0 (INT0_vect) handles Reset :-( on ATMega168.

Strangest thing: INT0 generates Reset and handling INT0 (INT0_vect) handles Reset :-( on ATMega168.

2011-01-24 by Cat C

Hi there,
 
I'm using an ATMega168-20AU to read a temperature sensor connected to PD2 (INT0).
The sensor sends it's data every second without being requested, so I chose INT0 to read it in an ISR whenever it sends it.
SO:
1. It doesn't work; and I don't expect it to work first try, BUT:
2. If I try to read it in the "INT0_vect" handler, the Reset button stops working, instead it goes to my Handler.
3. If I remove my Handler, the Sensor output resets the microcontroller.

 
 
My Interrupt setup does 2 things (sorry about the missalignment):
 
//EICRA = External Interrupt Control Register A
 EICRA = 0b00000010; //Change to "0b00001010" to ALSO read Temp2
//     ||||||||
//     ||||||\\ - ISC01:00, Interrupt Sense Control 0. Falling edge of INT0 generates INT
//     ||||\\-- - ISC11:10, Interrupt Sense Control 1. Falling edge of INT1 generates INT
//     \\\\---- - Reserved, always read "0"
//EIMSK = External Interrupt Mask Register
 EIMSK = 0b00000001; //Change to "0b00000011" to ALSO read Temp2
//     ||||||||
//     |||||||\ - INT0, External Interrupt Request 0 Enable
//     ||||||\- - INT1, External Interrupt Request 1 Enable
//     \\\\\\-- - Reserved, always read "0"

 
What am I doing wrong?
 
Thanks,
 
Cat

RE: [AVR-Chat] Strangest thing: INT0 generates Reset and handling INT0 (INT0_vect) handles Reset :-( on ATMega168.

2011-01-24 by Cat C

It looks like some of my interpretations were wrong, please ignore until I say more.
 
Thanks,
 
Cat

----------------------------------------
Show quoted textHide quoted text
> To: avr-chat@yahoogroups.com
> From: catalin_cluj@hotmail.com
> Date: Mon, 24 Jan 2011 15:05:39 -0700
> Subject: [AVR-Chat] Strangest thing: INT0 generates Reset and handling INT0 (INT0_vect) handles Reset :-( on ATMega168.
>
>
> Hi there,
>
> I'm using an ATMega168-20AU to read a temperature sensor connected to PD2 (INT0).
> The sensor sends it's data every second without being requested, so I chose INT0 to read it in an ISR whenever it sends it.
> SO:
> 1. It doesn't work; and I don't expect it to work first try, BUT:
> 2. If I try to read it in the "INT0_vect" handler, the Reset button stops working, instead it goes to my Handler.
> 3. If I remove my Handler, the Sensor output resets the microcontroller.
>
>
>
> My Interrupt setup does 2 things (sorry about the missalignment):
>
> //EICRA = External Interrupt Control Register A
> EICRA = 0b00000010; //Change to "0b00001010" to ALSO read Temp2
> // ||||||||
> // ||||||\\ - ISC01:00, Interrupt Sense Control 0. Falling edge of INT0 generates INT
> // ||||\\-- - ISC11:10, Interrupt Sense Control 1. Falling edge of INT1 generates INT
> // \\\\---- - Reserved, always read "0"
> //EIMSK = External Interrupt Mask Register
> EIMSK = 0b00000001; //Change to "0b00000011" to ALSO read Temp2
> // ||||||||
> // |||||||\ - INT0, External Interrupt Request 0 Enable
> // ||||||\- - INT1, External Interrupt Request 1 Enable
> // \\\\\\-- - Reserved, always read "0"
>
>
> What am I doing wrong?
>
> Thanks,
>
> Cat
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

Re: [AVR-Chat] Strangest thing: INT0 generates Reset and handling INT0 (INT0_vect) handles Reset :-( on ATMega168.

2011-01-25 by Cat

Basically the only thing that was NOT wrong (in my interpretation), was 
that:
if INT0 was enabled and triggered when there was no handler for it, it 
generated a reset (can't tell if directly).

The rest... side effects of things tried to debug through ISRs, etc.; my 
bad.

Cat
Show quoted textHide quoted text
-----Original Message----- 
Subject: RE: [AVR-Chat] Strangest thing: INT0 generates Reset and handling 
INT0 (INT0_vect) handles Reset :-( on ATMega168.


It looks like some of my interpretations were wrong, please ignore until I 
say more.

Thanks,

Cat
...

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.