Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

External Interrupt in Microblaze

Status
Not open for further replies.

eewonder

Newbie level 5
Joined
Jan 15, 2003
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
49
microblaze timer interrupt

I need a example code for External Interrupt in Microblaze. Could someone help me about this?
In a main program, how to declare and setup the external interrupt
In handler function, how to detect an external interrupt when it happen, and how to clear it?

Thanks in advance
 

manasiw2

Member level 1
Joined
Oct 3, 2007
Messages
39
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,476
Hi
which edk version u r using?there is difference betn interrupt handling of EDK 8.2 and 9.1...let me know.
 

eewonder

Newbie level 5
Joined
Jan 15, 2003
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
49
I figure out the solution

Thanks
 

Rob B

Full Member level 4
Joined
Oct 30, 2005
Messages
195
Helped
27
Reputation
56
Reaction score
18
Trophy points
1,298
Activity points
2,564
You must register the interrupt. I used EDK9.1 I think.

This might be of use:

Code:
void InterruptHandler(void);

int main(void)
  {
  microblaze_register_handler((XInterruptHandler)InterruptHandler, (void*)0);
  
  #ifdef DEBUG
  print("* Registered Interrupt Handler *\n\r");
  #endif

  microblaze_enable_interrupts();

  // Something useful here.

  return 0;
  }



void InterruptHandler(void)
  {
  #ifdef DEBUG
  print("* Entering Interrupt *\r\n");
  #endif
  microblaze_disable_interrupts();

  // Do something useful here :).
 
  microblaze_enable_interrupts();

  #ifdef DEBUG
  print("* Leaving Interrupt *\r\n");
  #endif
  }
 

omidsht

Member level 2
Joined
Dec 24, 2007
Messages
43
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,556
I want to start learning microblaze . can any body guide me what to read and where to get them ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top