I'm working on a RTOS for the PowerPC chip on the Virtex-II XUP board. I need an interrupt to trigger so I run my scheduler at regular intervals, so I setup the PIT to trigger an interrupt at 1s (purely for testing reasons, I will be going down to around 5ms). The program seems to pause when I finally enable the interrupt and I see no signs that the handler has been run. I looked at several references and spent a day shifting around my code, to no avail. If someone could take a peek at my code below and offer assistance that would be great. Thanks.
#include "xparameters.h" #include "stdio.h" #include "xbasic_types.h" #include "gpio_header.h" #include "xexception_l.h" #include "xtime_l.h"
Xuint32 status;
void pit_InterruptHandler(void *dataPtr) { status = 55; XTime_PITClearInterrupt(); }
int main(void) { Xuint32 DataRead; XExc_Init(); XExc_RegisterHandler(XEXC_ID_PIT_INT, (XExceptionHandler)pit_InterruptHandler, (void*) 0); XTime_PITSetInterval(100000); XTime_PITEnableAutoReload(); XExc_mEnableExceptions(XEXC_NON_CRITICAL); print("-- Entering main() --\r\n"); print("\r\nRunning GpioOutputExample() for LEDs_4Bit...\r\n"); status = GpioOutputExample(XPAR_LEDS_4BIT_DEVICE_ID,4); if(status == 0) { print("GpioOutputExample PASSED.\r\n"); } else { print("GpioOutputExample FAILED.\r\n"); } XTime_PITClearInterrupt(); XTime_PITEnableInterrupt(); print("Here\r\n"); status = 0; while(status != 55) { ; } print("-- Exiting main() --\r\n"); return 0; }
---Matthew Hicks