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

Unable to use GPIO pin 12 as output


Best Answer Chris Walker, 14 October 2013 - 12:40 AM

Hi Kjetil, Cpu.Pin.GPIO_Pin12 refers to pin 12 on the microcontroller, rather than to digital pin header D12. Try this instead: Pins.GPIO_PIN_D12 Does that get you up and running? Chris Go to the full post


  • Please log in to reply
2 replies to this topic

#1 netiness

netiness

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationNorway

Posted 13 October 2013 - 05:01 PM

Hello all,

I'm all very new to this, so please excuse a beginner for asking questions; I've only had the NP2 for a couple of weeks.

I was under the impression that any pin could be used for gpio, but if I try to use Pin 12 for output, the NP2 crashes - so hard that I have to reflash the firmware. Also, if I remove the USB cable before Visual Studio times out the connection I am greated with a BSOD.

 

This statement stop everything for me:

public OutputPort SpindlePort = new OutputPort(Cpu.Pin.GPIO_Pin12, false);

Pin 13 is OK to use, but is there any reason for me not being able to use Pin 12 as I want to (or do I have to disable something since this pin belongs to the SPI interface) ?

 

Regard,

Kjetil



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 October 2013 - 12:40 AM   Best Answer

Hi Kjetil, Cpu.Pin.GPIO_Pin12 refers to pin 12 on the microcontroller, rather than to digital pin header D12. Try this instead: Pins.GPIO_PIN_D12 Does that get you up and running? Chris

#3 netiness

netiness

    Member

  • Members
  • PipPip
  • 10 posts
  • LocationNorway

Posted 14 October 2013 - 02:02 PM

Ooh, that was embarassing. Of course it works using the correct pin identifier. Thanks for a quick reply.

 

Kjetil






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.