cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
clem_g
Newbie
Newbie
12,082 Views
Registered: ‎09-08-2007

Interrupt routine

I wish to implement a timer interrupt without using the xilinx driver for the PPC processor Virtex4 FX. EDK 9.1 used to build hardware with 32 bit interrupt timer. I would have thought it trivial to write and load an interrupt service routine which calls an external function and returns. What is required is the int_service_routine(), function_to_load_it( (int_service_routine)) and intEnable() and intDisable(). Can anyone point me in the right direction for an example of this.

Clem.


0 Kudos
4 Replies
Chadn_na
Xilinx Employee
Xilinx Employee
12,052 Views
Registered: ‎08-15-2007

I am not sure if this is really what you are looking for but XAPP 778 provides examples for setting up ISRs.
0 Kudos
jeffrey.johnson
Voyager
Voyager
11,643 Views
Registered: ‎02-07-2008

Here is an online tutorial for developing a timer peripheral with interrupt capability. It walks you through all the steps, with screenshots and source code.

Timer with Interrupts

I hope this helps.
Message Edited by jeffrey.johnson on 01-21-2009 06:01 AM
0 Kudos
centaur19
Xilinx Employee
Xilinx Employee
11,633 Views
Registered: ‎08-01-2007

Clem,

If you check the EDK install, there is an example that does just what you are trying to do. There is a system created with Virtex 4 FX, PowerPC and timer.

<9.1i EDK_Install>\EDKexamples\Virtex4_PPC_Example_9_1.pdf

HTH
0 Kudos
hjt_on_razer
Visitor
Visitor
11,601 Views
Registered: ‎03-19-2008

Here is a little code snipit using the PPC PIT timer
 
    /* Initialise the interrupt vector table*/
    XExc_Init();
   
    /* Register PPC405 timer interrupt handler */
    XExc_RegisterHandler(XEXC_ID_PIT_INT, (XExceptionHandler)timer_interrupt, (void *)0);
 
    /* initialise the PIT timer to interrupt every 1 second */
    XTime_PITSetInterval(ONE_SECOND_TICK);
 
    /* clear all the timer status register bits */
    XTime_TSRClearStatusBits(XREG_TSR_CLEAR_ALL);
 
    /* set to auto reload so always interrupts at same time */
    XTime_PITEnableAutoReload();
 
    /* clear any pending PIT interrupts */
    XTime_PITClearInterrupt();
 
    /* enable the PIT interrupt */
    XTime_PITEnableInterrupt();
   
   
void timer_interrupt (void *baseaddr_p)
{
   
    XTime_PITClearInterrupt();      /* clear any pending PIT interrupts */

/* perform required actions here */
 
Hope that helps
0 Kudos