- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
How can I get just a single interrupts from a push-io. I have tried changing the SOPC for the push-io to generate only from a rising/falling edge change and that does not seem o help. basing myself off the counting binary example. They had it setup initially to generate interrupts on both the rising and falling edge, which is what I am seeing. however, I cannot seem to change that behaviour. Thanks, VinceLink Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Vmathieu,
Switches don't always open and close in one clean change of state, they often 'bounce' a bit. Maybe your interrupt is responding to this. If you are just getting multiple interrupts then maybe you aren't clearing the interrupt source i.e. writing to the PIO edge capture register. Banx.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by banx@Sep 7 2006, 03:15 PM hi vmathieu,
switches don't always open and close in one clean change of state, they often 'bounce' a bit. maybe your interrupt is responding to this.
if you are just getting multiple interrupts then maybe you aren't clearing the interrupt source i.e. writing to the pio edge capture register.
banx.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18140)
--- quote end ---
--- Quote End --- Hi, I am using some of the code from the tutorial thats clear the reg after getting an interrupt. See below. With this printf I have added I cleary see that I am getting an interrupt when pushing the button down, and then another when I release it. Thanks, Vince static void handle_button_interrupts(void* context, alt_u32 id) { /* Cast context to edge_capture's type. It is important that this be * declared volatile to avoid unwanted compiler optimization. */ volatile int* edge_capture_ptr = (volatile int*) context; /* Store the value in the Button's edge capture register in *context. */ *edge_capture_ptr = IORD_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_PIO_BASE); printf("\n intrrpt\n"); /* Reset the Button's edge capture register. */ IOWR_ALTERA_AVALON_PIO_EDGE_CAP(BUTTON_PIO_BASE, 0); }
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page