Forum Discussion
Altera_Forum
Honored Contributor
13 years agoHello There,
External Interrupt controller VIC have better speed performance then internal interrupt controller but in my sample code (below) for understanding VIC, won't reflect edge_capture status on pin TEMP_OUT_BASE like if edge_capture get high it will put 1 on TEMP_OUT_BASE otherwise put 0 on TEMP_OUT_BASE. my aim is to reading 2D-array whenever edge_capture get interrupt. "IOWR_ALTERA_AVALON_PIO_DATA(TEMP_OUT_BASE,0x1)" *i have attached my sopcinfo for refrence.
int main()
{
int rc;
unsigned long int count =0;
printf("\n\tInitillize the Enhanced Interrupt..");
# ifdef LOAD_DATA_BASE
init_load_data();
# endif
rc = alt_ic_irq_enable(VIC_INTERRUPT_CONTROLLER_ID,LOAD_DATA_IRQ);
if(rc<0) printf("\n\tEnhance Interrupt NOT enabled, Return value = %d\n",rc);
else printf("\n\tEnhnace interrupt ENABLED, Return value = %d\n",rc);
/* //---Should i add these alt_ic_irq_enable for other peripheral also...........??
rc = alt_ic_irq_enable(VIC_INTERRUPT_CONTROLLER_ID,JTAG_UART_IRQ);
rc = alt_ic_irq_enable(VIC_INTERRUPT_CONTROLLER_ID,SYS_CLK_TIMER_IRQ);
*/
IOWR_ALTERA_AVALON_PIO_DATA(STRT_OUT_BASE,HIGH); //Generate Start Signal
do
{
if(edge_capture)
{
IOWR_ALTERA_AVALON_PIO_DATA(TEMP_OUT_BASE,0x1); //TEMP_OUT not Visible on Oscilloscope
edge_capture = 0; //Clear Interrupt
//printf("\nHIGH"); //Visible on Console
}
IOWR_ALTERA_AVALON_PIO_DATA(TEMP_OUT_BASE,0x0);
//printf("\t\tLOW\n"); //Visible on Console
}while(1);
return 0;
}
Regards kaushal