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

Interrupt/Event Problem


  • Please log in to reply
8 replies to this topic

#1 Jporter

Jporter

    New Member

  • Members
  • Pip
  • 3 posts

Posted 19 November 2010 - 04:29 PM

I'm having issues triggering interrupts after I have received serial data using the SerialDataReceivedEventHandler. For example: someButton = new InterruptPort(Pins.GPIO_PIN_D10, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow); someButton.OnInterrupt += new NativeEventHandler(someButton_OnInterrupt); serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived); serialPort.Open(); If I click the button connected to pin 10, the button event is triggered just fine. If I then send some serial data to the netduino, triggering the serialPort_DataReceived, then try again to click the button, the button event is not triggered. Why is this?

#2 AlfredBr

AlfredBr

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationConnecticut, USA

Posted 19 November 2010 - 05:46 PM

If I click the button connected to pin 10, the button event is triggered just fine. If I then send some serial data to the netduino, triggering the serialPort_DataReceived, then try again to click the button, the button event is not triggered. Why is this?

Make sure that 'someButton' does not go out of scope and is then 'Disposed'.
(Post a bigger example so we can take a look.)

#3 Jporter

Jporter

    New Member

  • Members
  • Pip
  • 3 posts

Posted 20 November 2010 - 07:57 AM

I have attached my program. BTW, it does not make any difference with or without the thread.sleep in the main loop? What could be causing this problem? Thanks.

Attached Files



#4 mrxer

mrxer

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationAustralia

Posted 28 November 2010 - 01:24 PM

I have attached my program. BTW, it does not make any difference with or without the thread.sleep in the main loop?
What could be causing this problem?
Thanks.



anyone resolved this issue..i am having gthe same issue! SerialDataReceivedEventHandler not always firing..

tony


#5 mrxer

mrxer

    Advanced Member

  • Members
  • PipPipPip
  • 54 posts
  • LocationAustralia

Posted 28 November 2010 - 01:26 PM

I'm having issues triggering interrupts after I have received serial data using the SerialDataReceivedEventHandler. For example:

someButton = new InterruptPort(Pins.GPIO_PIN_D10, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
someButton.OnInterrupt += new NativeEventHandler(someButton_OnInterrupt);

serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived);
serialPort.Open();

If I click the button connected to pin 10, the button event is triggered just fine. If I then send some serial data to the netduino, triggering the serialPort_DataReceived, then try again to click the button, the button event is not triggered. Why is this?



Did you resolve this problem?

tony


#6 Jporter

Jporter

    New Member

  • Members
  • Pip
  • 3 posts

Posted 28 November 2010 - 11:25 PM

Not exactly. I got around the problem by trigerring on one edge. I wonder if this is a Netduino issue or .net MF issue? If it is the latter, I shoudl post the problem on the microsoft mf forums.

#7 Rod Lopez

Rod Lopez

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts
  • LocationSweden

Posted 04 April 2011 - 09:50 AM

Are there any news regarding this issue? I have the same SerialDataReceivedEventHandler-not-triggered issue with an extra bit of info, my event gets triggered if I am debugging from the PC, if the netduino runs standalone (as in non-f5, just a local reset) then I never get the events. I have changed the code to constantly look for serial data in the main loop and then it works, ideas? suggestions? popcorn?

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 04 April 2011 - 07:00 PM

Are there any news regarding this issue?
I have the same SerialDataReceivedEventHandler-not-triggered issue with an extra bit of info, my event gets triggered if I am debugging from the PC, if the netduino runs standalone (as in non-f5, just a local reset) then I never get the events.
I have changed the code to constantly look for serial data in the main loop and then it works, ideas? suggestions? popcorn?


Hi Rod,

Have you updated the firmware on your Netduino? The v4.1.0.6 and v4.1.1_beta firmware releases fixed 3 bugs in the SerialPort implementation. Ones that sound very similar to what you're experiencing.

Chris

#9 Rod Lopez

Rod Lopez

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts
  • LocationSweden

Posted 12 April 2011 - 09:34 PM

Hi Chris, Nope, I haven't updated the firmware (I am trying to keep my schedule for releasing something and I am afraid of the "beta" moniker) What I have done is check out the changes and follow the description of the fix to one of the bugs (surely the same you think) to figure out and avoid the bug at setup-time, and it does work as expected. I am pretty confident the firmware upgrade will make my fix redundant :)




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.