FX2/FX2LP GPIF Done Interrupt Doesn't Fire
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Answer:
Generally speaking, the GPIF done interrupt should fire when after bursting GPIFTC number of bytes or words. Check to make sure that the INT4 interrupts are enabled as well as the individual GPIF done interrupt. Using the polling method is a perfectly acceptable method, and should not be a throughput limitation. In any case, here is what you need to do to setup the GPIF done interrupt and detect the event in the foreground loop, TD_Poll():
In TD_Init():
// setup INT4 as internal source for GPIF interrupts
// using INT4CLR (SFR), automatically enabled
INTSETUP |= 0x03; // Enable INT4 FIFO/GPIF Autovectoring
SYNCDELAY;
EXIF &= ~0x40; // just in case one was pending...
SYNCDELAY;
GPIFIRQ = 0x01; // clear GPIFDONE interrupt
SYNCDELAY;
GPIFIE = 0x01; // Enable GPIFDONE interrupt
SYNCDELAY;
EIE |= 0x04; // Enable INT4 ISR, EIE.2 (EIEX4=1)
The global flag gpif_done is set in the ISR:
void ISR_GpifComplete(void) interrupt 0
{
gpif_done = TRUE;
EXIF &= ~0x40;
INT4CLR = 0xFF; // automatically enabled at POR
SYNCDELAY;
}
The foreground loop TD_Poll detects the gpif_done flag
and clears it:
while( !( gpif_done ) ) // wait for GPIFDONE interrupt
{
;
}
gpif_done = FALSE; // clear gpif_done global flag
-
This widget could not be displayed.Anonymous