Yahoo Groups archive

AVR-Chat

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

Thread

External Interrupts 6 and 7

External Interrupts 6 and 7

2006-02-18 by eccamacho

I'm trying to enable External Interrupts 6 and 7, but I can't seem to
get them working. 

Here's my init code:

    DDRD  = 0x00;                // set port D for input
    PORTD = 0xff;                // activate internal pull-up

    cbi(EICRB,ISC61);            // set sense control for any edge
    cbi(EICRB,ISC71);
    sbi(EICRB,ISC60);
    sbi(EICRB,ISC70);
    EIMSK = (1<<INT6) | (1<<INT7); // enable interrupts 6 and 7
    sei();    

My main program is just a tight loop.  The interrupt just toggles
an LED.

SIGNAL(SIG_INTERRUPT6)
{
    LED_OFF(RED);
    if (ledOn == 1)
    {
       LED_OFF(BLUE);
       ledOn = 0;
    }else{
       LED_ON(BLUE);
       ledOn = 1;
    }
}


I don't have any indication that the interrupt is firing though.  I
believe I'm hooked up to the right pins on my board (atmega128 btw).

Anything I'm missing to enable these interrupts?

Thanks, 
Ed

Re: [AVR-Chat] External Interrupts 6 and 7

2006-02-18 by John Samperi

At 03:17 AM 19/02/2006, you wrote:

>I don't have any indication that the interrupt is firing though.  I
>believe I'm hooked up to the right pins on my board (atmega128 btw).

The interrupt pins will need to be properly debounced with a resistor
and cap or the interrupt will fire many times with unpredictable results.

You many want to put a small delay (say 100ms) and keep the interrupts
off so you will see the led blink on if the above is happening.

Do you have a JTAG ice? If you do put a breakpoint at the interrupt handling
routine to see if they are firing.

This will get you started, haven't checked yourset up so I'm assuming that
you are doing the correct thing.

Regards

John Samperi

********************************************************
Ampertronics Pty. Ltd.
11 Brokenwood Place Baulkham Hills, NSW 2153 AUSTRALIA
Tel. (02) 9674-6495       Fax (02) 9674-8745
Email: john@ampertronics.com.au
Website  http://www.ampertronics.com.au
*Electronic Design * Custom Products * Contract Assembly
********************************************************

Re: External Interrupts 6 and 7

2006-02-19 by enkitec

--- In AVR-Chat@yahoogroups.com, "eccamacho" <eccamacho@...> wrote:
> 
>     cbi(EICRB,ISC61);            // set sense control for any edge
>     cbi(EICRB,ISC71);
>     sbi(EICRB,ISC60);
>     sbi(EICRB,ISC70);


   If using Assembler, you can't use SBI/CBI on extended registers.

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.