Interrupts

From RCSWiki

Revision as of 20:20, 2 April 2008 by Skdatta (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Hardware Connections

  1. Open up xps. (9.1 or 9.2 tools - doesnt make a difference)
  2. Create a basic base system with ML410, powerPC at 300 MHz, bus frequency 100 MHz memory components and some peripherals.
  3. Check for interrupt while selecting the UART. If you dont want to add UART to your system, dont worry...no problem.
  4. Now while creating the core, make sure to select on interrupt control uder IPIF Services page.
  5. Add your core to the system.
  6. In xps under system assembly view, under Bus interfaces option, make sure that the intc is connected to a bus. If you are using the 9.2 tools, it will be as xps_intc_0 connected to the PLB. In the 9.1 tools, it will opb_intc_0 connected to the OPB. (**if you cannot find the interrupt controller, click onIPcatalog on the left and under Clock, Reset and Interrupt, double click on xps interrupt controller.
  7. Make sure to connect the intc to the bus.
  8. Next ckick on Cports and under ppc405_0, make sure to have port EICC405EXTINPUTIRQ connected to L to H: EICC405EXTINPUTIRQ ( this is the connection between the intc and the ppc)
  9. Under the intc port, make sure to connect Irq port to EICC405EXTINPUTIRQ. You should get these options using the drop down box.
  10. Next go to your core and connect the intr port to the interrupt signal form the core.
  11. If you click on the intr port on the onterrupt controller, you should be able to see all the inerrupts signals connected to it with their priorities.
  12. synthesize.

Software Code

  1. Couple of functions are required.
  2. XExc_Init(); -- initializes the exception handling in the powerpc.
  3. XIntc_mMasterEnable(XPAR_OPB_INTC_0_BASEADDR); -- enables the interrupt controller.
  4. XExc_RegisterHandler(XEXC_ID_NON_CRITICAL_INT, XIntc_DeviceInterruptHandler, (void *)0);
  5. XIntc_RegisterHandler(XPAR_INTC_0_BASEADDR, <interrupt name form xparameters.h>, <isr function name>,(void)*0);
  6. XIntc_mEnableIntr(XPAR_INTC_0_BASEADDR, <name of the interrupt mask form xparameters.h>); -- enable the interrupt controller in the user core. This function is in the core's driver in the drivers directory.
  7. Make sure to disbale the interrupts in the isr or it will loop infinitely.

DONE!!!

Personal tools