PROBLEMS WITH EXTERNAL INTURRUPTS

General discussion on mikroBasic PRO for AVR.
Post Reply
Author
Message
SPOTLIGHT81
Posts: 9
Joined: 29 Jan 2022 10:25

PROBLEMS WITH EXTERNAL INTURRUPTS

#1 Post by SPOTLIGHT81 » 29 Jan 2022 10:44

Hello all
I hope you are fine
I'm new here and also with AVR
Please help with this problem
I'm trying to use the three external interrupts together at the same time timer 1
But the error always appears and the build does not work
note that i have no header files for interrupts or else, i mean
ATMEGA32 MICRO C FOR AVR

thank you

Code: Select all

ISR (INT0_VECT)
{
 GIFR.INT0 = 1;
/// CODE HERE ///
}

ISR (INT1_VECT)
{
 GIFR.INT1 = 1;
 /// CODE HERE ///
}

ISR (INT2_VECT)
{
 GIFR.INT2 = 1;
 /// CODE HERE ///
}


void main (void)
{

GICR = 0xE0; // (1 << INT0 | 1 << INT1 | 1 << INT2); //enable intrupt on INT0,INT1,INT2
MCUCR = (1 << ISC01 | 1 << ISC00 | 1 << ISC11 | 0 << ISC10 | 0 << ISC2);  
SREG = 0x80; // ENABLE GLOBAL INTERRUPT BIT

while (1)  {
             ///  main cde place ///
                 }
}

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: PROBLEMS WITH EXTERNAL INTURRUPTS

#2 Post by filip » 18 Feb 2022 12:22

Hi,

For proper interrupt operation, please have a look a the Interrupt Help file topic and the following example :
\mikroC PRO for AVR\Examples\Internal MCU modules\ATmega16\Timer0 Interrupt\

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for AVR General”