Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHow to use interrupt?
Hello. I want to use interrupt from USER_PIO, but I don't know how to use. I tried this sample code , but it seems that ISR is not executed. (I modified two point. *definition of...
Altera_Forum
Honored Contributor
20 years agoI'm in the same problem as m_isshiki (and also a newbie http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif ).
Without eCos, i used my interrupt this way: static void HandleRising1Interrupt(void *context, alt_u32 id) { // Do the interrupt routine stuff // ... IOWR_ALTERA_AVALON_PIO_EDGE_CAP(PIO_INT_RISING1_BASE, 0); } void main() { IOWR_ALTERA_AVALON_PIO_IRQ_MASK(PIO_INT_RISING1_BASE, 0xF); IOWR_ALTERA_AVALON_PIO_EDGE_CAP(PIO_INT_RISING1_BASE, 0); alt_irq_register(PIO_INT_RISING1_IRQ, (void *) 0, HandleRising1Interrupt); // The rest of the application // ... } My interrupt is defined by the following constants in system.h: /* * pio_int_rising1 configuration * */ # define PIO_INT_RISING1_NAME "/dev/pio_int_rising1"# define PIO_INT_RISING1_TYPE "altera_avalon_pio"# define PIO_INT_RISING1_BASE 0x02000820# define PIO_INT_RISING1_IRQ 4# define PIO_INT_RISING1_DO_TEST_BENCH_WIRING 0# define PIO_INT_RISING1_DRIVEN_SIM_VALUE 0x0000# define PIO_INT_RISING1_HAS_TRI 0# define PIO_INT_RISING1_HAS_OUT 0# define PIO_INT_RISING1_HAS_IN 1# define PIO_INT_RISING1_CAPTURE 1# define PIO_INT_RISING1_EDGE_TYPE "RISING"# define PIO_INT_RISING1_IRQ_TYPE "EDGE"# define PIO_INT_RISING1_FREQ 70000000 As you can see, it's defined as a "rising edge" interrupt. Now I'm trying to do the same with eCos, using a similar code to that used by m_isshiki, but with no result. Could anybody please explain how to handle my interrupt with eCos? Thank you very much. --- Quote Start --- originally posted by m_isshiki@Dec 13 2005, 08:48 AM can you give me some advice?i am really in trouble.
i use stratixii dev kit.
so, hardware should be ok.
but i'm not sure how to use interrupt.
thank you.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11507)
--- quote end ---
--- Quote End ---