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.

handling ISR in ATMEGA32

Status
Not open for further replies.

Jayk

Junior Member level 1
Joined
Dec 18, 2011
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Rajkot,India
Activity points
1,426
I want help in writing ISR in atmega32 programming.In my program i have two interrupt one for ADC and another for timer0 overflow flag.I want to call the ISR on timer0 overflow.how can i write the code ?
 

Jayk said:
I want to call the ISR on timer0 overflow.how can i write the code ?
If someone translates that strictly then you cannot call an ISR, it comes when you don't expect it (that's why it is called "interrupt":)).
If you mean that the ADC interrupt must run in any case, then all you have to do inside timer's interrupt and in the first line of this function, is to enable interrupts globally:

Code:
void TimerIsr (void)  //random ISR name
{
  asm("sei");
  //..........
  //..........
  //..........
}

Don't expect something more fancy like interrupt priorities etc, AVR interrupt system is not that advanced.

Hope this helps.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top