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

System.ArgumentException when using GPIO Pin 9


  • Please log in to reply
7 replies to this topic

#1 RobinBones

RobinBones

    New Member

  • Members
  • Pip
  • 6 posts

Posted 03 February 2013 - 06:47 PM

I have a netduino plus 2, and for some reason, when using Pin 9 I get a System.ArgumentException (in Microsoft.SPOT.Hardware.dll).

 

I can use pins 0-8 and 10-11 with no issue (I haven't tried anything higher).

 

This works weather I have anything plugged into the pin or not. Any Ideas?



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 February 2013 - 08:29 PM

Hi Robin, Can you share your code really quickly? A repro of <20 lines total? Chris

#3 RobinBones

RobinBones

    New Member

  • Members
  • Pip
  • 6 posts

Posted 07 February 2013 - 02:39 AM

Sure, there isn't  much..

 

        Dim InputPorts(11) As InterruptPort        InputPorts(0) = New InterruptPort(Pins.GPIO_PIN_D0, True, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth)...        InputPorts(8) = New InterruptPort(Pins.GPIO_PIN_D8, True, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth)        InputPorts(9) = New InterruptPort(Pins.GPIO_PIN_D9, True, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth)        InputPorts(10) = New InterruptPort(Pins.GPIO_PIN_D10, True, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth)        InputPorts(11) = New InterruptPort(Pins.GPIO_PIN_D11, True, Port.ResistorMode.PullDown, Port.InterruptMode.InterruptEdgeBoth)

I am declaring an array, then assigning each port. 0-8, 10-12 works fine. For some reason I get an exception when I try Pin9

 



#4 Alek

Alek

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationMonza

Posted 05 June 2013 - 10:30 AM

Hi Guys

did u find the solution? I'm facing the same issue

thanks

 

Alek


Alek      :)

 

Brained in Italy


#5 Verdris

Verdris

    Advanced Member

  • Members
  • PipPipPip
  • 128 posts
  • LocationReno, NV

Posted 05 June 2013 - 06:08 PM

From the schematics, it looks like pin 9 is also shared by the SPI bus that the Ethernet encoder sits on. Maybe that's why it's not so happy being declared as an interrupt?



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 June 2013 - 08:01 PM

Robin, Alek: Does the pin work alright when you open just _it_ up? Or does the problem only happen when you also use certain other pins at the same time? Our test jigs open up each digital pin as both an OutputPort and an InputPort for testing so I'm 100% positive that all pins work :) if there's a weird resource conflict going on here that's something we can pull into the lab to fix. One more thing: does this only happen when you open the port as an InterruptPort (versus an InputPort)? Do you also have any of pins D0-D2 configured as an InterruptPort? Chris

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 June 2013 - 08:03 PM

Hi Verdris,

From the schematics, it looks like pin 9 is also shared by the SPI bus that the Ethernet encoder sits on. Maybe that's why it's not so happy being declared as an interrupt?

Just FYI--the way that the STM32 microcontroller works, we can pick from several options of pins to use as the SPI bus pins. With Netduino Plus 2, we've configured different pins to operate as the SPI bus...so that won't conflict here. Good idea though; I'm really glad that you guys are reading the datasheets too. Lots of great data in there. I'm also really happy how much you help each other out :) This is an awesome community. Chris

#8 Alek

Alek

    New Member

  • Members
  • Pip
  • 8 posts
  • LocationMonza

Posted 05 June 2013 - 08:21 PM

Chris,

I have create a brand new project and declared the pin 9 and it works ok, then I switched back to the original and I have removed from the project some external dll that were not supposed to access to the pins and now it works.

I'll open the sources of the external dll and check, maybe they recall the pin in some way...

I'll let u know

Thanks

 

Alek


Alek      :)

 

Brained in Italy





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.