InterruptPort
#1
Posted 14 August 2010 - 12:23 AM
#2
Posted 14 August 2010 - 12:41 AM
I'm trying to use InterruptPort class on the onboard switch and apparently it's not working. This brought me to question which digital I/O pin supports InterruptPort??
All pins (plus the pushbutton) can be used as InterruptPorts. Have you had a chance to look at the "event handler" advanced tutorial on the Projects page? Also, there's some sample InterruptPort code by one of our users in the forums...
If you can show us what you're doing in code and what you're trying to accomplish, perhaps we can all take a look and help you sort it out as well...
Chris
#3
Posted 14 August 2010 - 12:55 AM
All pins (plus the pushbutton) can be used as InterruptPorts. Have you had a chance to look at the "event handler" advanced tutorial on the Projects page? Also, there's some sample InterruptPort code by one of our users in the forums...
If you can show us what you're doing in code and what you're trying to accomplish, perhaps we can all take a look and help you sort it out as well...
Chris
Hi Chris,
Yeah, I know how delegates and events work. I've been coding professional for 10+ years. I found out why my InterruptPort wasn't working!! It was the glitchFilter, I set it to true. I remember reading it somewhere that if you set the glitchFilter to true, that will automatically handle switch debouncing for you. Could you clarify the use of this parameter for me as I am confused now. And thanks for the quick reply. You guys are doing great job helping the Netduino community to get started.
xc2rx
#4
Posted 14 August 2010 - 08:36 PM
Hi Chris,
Yeah, I know how delegates and events work. I've been coding professional for 10+ years. I found out why my InterruptPort wasn't working!! It was the glitchFilter, I set it to true. I remember reading it somewhere that if you set the glitchFilter to true, that will automatically handle switch debouncing for you. Could you clarify the use of this parameter for me as I am confused now. And thanks for the quick reply. You guys are doing great job helping the Netduino community to get started.
xc2rx
Hi xc2rx,
I found the same thing that you did with the glitchFilter parameter. (BTW, I'm the guy who posted the ToggleButton sample that Chris referred to).
In the ToggleButton sample, if I set the InterruptPort's glitchFilter parameter to true, it seems that the interrupts don't fire (or the event associated with the interrupt doesn't fire - not sure which one).
@Chris - is there a way we can investigate this further?
~ David ~
#5
Posted 15 August 2010 - 05:06 PM
Hi xc2rx,
I found the same thing that you did with the glitchFilter parameter. (BTW, I'm the guy who posted the ToggleButton sample that Chris referred to).
In the ToggleButton sample, if I set the InterruptPort's glitchFilter parameter to true, it seems that the interrupts don't fire (or the event associated with the interrupt doesn't fire - not sure which one).
@Chris - is there a way we can investigate this further?
Hi Dab,
Yes your example triggered my mistake. I was coding a switch button example and it didn't work until I saw the difference on your example. Then I turned the glitchFilter parameter off and it worked!! Like I said, i thought the glitchParameter was suppose to be for switch debouncing. If it is turned off, then the programmer is responsible for switch debouncing. If it is turned on, then switch debouncing is being handled automatically. Apparently this is not the case. In my example, when i turned on glitchFilter, no event gets triggered. When I turned it off, it worked perfectly with switch debouncing done automatically. Maybe the value got reversed? true is now false and false is now true? Could someone please investigate what's going on here??
#6
Posted 15 August 2010 - 05:15 PM
#7
Posted 16 August 2010 - 12:49 AM
#8
Posted 16 August 2010 - 01:25 AM
Quick update... We found the problem. A single line of code in the GPIO debouncer code was causing the glitch in the glitchfilter.
We have implemented the GlitchFilter fix in the v4.1.0.2 (4.1.0 patch 2) update along with the AnalogInput bugfix. The updated firmware will be posted by tomorrow.
Chris
Can I get credit for that hahaha j/k
#9
Posted 16 August 2010 - 07:30 AM
Quick update... We found the problem. A single line of code in the GPIO debouncer code was causing the glitch in the glitchfilter.
We have implemented the GlitchFilter fix in the v4.1.0.2 (4.1.0 patch 2) update along with the AnalogInput bugfix. The updated firmware will be posted by tomorrow.
Chris
Cool, I'll be sure to try it out (tomorrow).
~ David ~
#10
Posted 16 August 2010 - 07:37 AM
#11
Posted 16 August 2010 - 09:16 PM
Can I get credit for that hahaha j/k
Oh yes, absolutely. A big thank you to xc2rx for starting this thread and alerting us to the GlitchFilter issue.
Perhaps we could "dedicate" bug fixes to our community members?
P.S. Anyone else who alerted us to this issue...thank you as well. I don't want to leave anyone out!
#12
Posted 17 August 2010 - 12:09 AM
Or maybe you could award Fabulous PrizesTM to the top bug finders (like a Netduino board or a trip to Hawaii).Perhaps we could "dedicate" bug fixes to our community members?
~ David ~
#13
Posted 17 August 2010 - 12:28 AM
Or maybe you could award Fabulous PrizesTM to the top bug finders (like a Netduino board or a trip to Hawaii).
Great idea. You never know what might happen...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users