Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

InterruptEdgeLevelHigh


Best Answer EddieGarmon, 28 April 2015 - 01:25 PM

kalio20, good try, but that will not work.

 

InteruptMode.InterupEdgeLevelHigh is not supported in the firmware currently.

 

To fake what you want, use InteruptEdgeHigh, and then manually disable and re-enable the interrupt in your handler.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 kalio20

kalio20

    Member

  • Members
  • PipPip
  • 22 posts

Posted 19 April 2015 - 05:41 PM

Hi,

 

if I set my Digital Input as:

InterruptPort DP09 = new InterruptPort(Pins.GPIO_PIN_D9, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLevelHigh);

 

it always throws errors and I dont know why, if i use Port.InterruptMode.InterruptEdgeLow instead, everything works fine, it seems it got a Problem with Port.InterruptMode.InterruptEdgeLevelHigh, or I am doin something wrong^^

 

Thanks in advance

 

 

Kalio!



#2 brianmakabro

brianmakabro

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationLouisville, KY

Posted 20 April 2015 - 03:08 AM

If you want to interrupt on EdgeLevelHigh - is it possible you should maybe use an external pull-down resistor on that line?  

 

Brian 



#3 kalio20

kalio20

    Member

  • Members
  • PipPip
  • 22 posts

Posted 20 April 2015 - 08:07 AM

Thx for your reply,

 

i set now: 

InterruptPort DP09 = new InterruptPort(Pins.GPIO_PIN_D9, false, Port.ResistorMode.PullDown ,Port.InterruptMode.InterruptEdgeLevelHigh);

as u said.

 

But it still throws errors and stop my programm.

Thanks in advance.

 

kalio



#4 brianmakabro

brianmakabro

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationLouisville, KY

Posted 27 April 2015 - 02:02 PM

Can you post the code?



#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 April 2015 - 06:56 PM

Hi kalio20,

"InterruptEdgeLevelHigh" means that you want the interrupt to fire when the level is high--and continue firing over and over and over again until the level goes low.

"InterruptEdgeHigh" means that you want the interrupt to fire once every time the level transitions from low to high.

I think you want the latter one. I'm not sure why the word "edge" made it into the "edgelevelhigh" option...but it can be confusing :) [And it's InterruptEdgeHigh that's supported in the base BSP.]

Does that help get you on the right path?

Chris

P.S. Thank you for your help on this, brianmakabro! Much appreciated.

#6 kalio20

kalio20

    Member

  • Members
  • PipPip
  • 22 posts

Posted 28 April 2015 - 12:18 PM

Hi Chris, 

 

thx for your response, but i need the first one, i need the Interrupt as long as it is high. Right know i use the "InterruptEdgeBoth" wich works indirect like the "InterruptEdgeLevelHigh", but i propably fixed it, i am not sure if it works but it will look like this:

 

DP09.ClearInterrupt();

DP09.Resistor = Port.ResistorMode.PullDown;

DP09.Interrupt = Port.InterruptMode.InterruptEdgeLevelHigh;
                            DP09.EnableInterrupt();
 
I have to clear the Interrupt if i switch the Port.Interrupt Mode to LevelHigh or LevelLow. Not sure if it works, will try it soon!
 
Greets
 
kalio.


#7 EddieGarmon

EddieGarmon

    Member

  • Members
  • PipPip
  • 24 posts

Posted 28 April 2015 - 01:25 PM   Best Answer

kalio20, good try, but that will not work.

 

InteruptMode.InterupEdgeLevelHigh is not supported in the firmware currently.

 

To fake what you want, use InteruptEdgeHigh, and then manually disable and re-enable the interrupt in your handler.



#8 kalio20

kalio20

    Member

  • Members
  • PipPip
  • 22 posts

Posted 28 April 2015 - 01:47 PM

Thank you very much Eddie Garmon,

 

now one more mystery is solved! I will give it a try with your "fake" method  :)

 

Greets

 

kalio20






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.