Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Interruption problems

Hello,

I am trying to interrupt a video signal. I am using the hsmc quad video card of Bitec associated to a cyclone III C25 Altera card. An interruption is supposed to be generated at each frame.

I think I have a problem with the nios code because I don't really understand what is the context, and what I should put in the edge_capture variable.

I tried to adapt the interuption program which worked on buttons but no success. It should print "coincoin" whenever an interruption occurs. I put below the parts of my program corresponding to the interruption. Tell me if you need more details.

I am really stuck there... Thanks for helping !

Myriam

Program :

volatile int pouet=0;

volatile int edge_capture;

static void handle_DMA_interrupts(void* context, alt_u32 id)

{

volatile int* edge_capture_ptr = (volatile int*) context;

if (pouet==0) pouet = 1;

}

Then in, the main :

...

IOWR(video_in_base[0], 0x0, 0x08 ); // enable bit for interrupt

IOWR_ALTERA_AVALON_PIO_IRQ_MASK(VIDEO_1_BASE, 0x01);

alt_irq_register( VIDEO_1_IRQ,&edge_capture, handle_DMA_interrupts );

while ( 1 == 1 )

{

if (pouet == 1)

{printf("coincoin");

pouet == 0;

}

...

}
No RepliesBe the first to reply