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 Resistor Mode Options?


  • Please log in to reply
3 replies to this topic

#1 sjmill01

sjmill01

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts
  • LocationSouth Carolina

Posted 13 June 2015 - 03:12 PM

I have used these lines of code successfully for PWM:

 

inputPort13 = new InterruptPort(Pins.GPIO_PIN_D13, true, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            inputPort13.OnInterrupt += new NativeEventHandler(inputPort_OnInterrupt13);

For ResistorMode, if I use "Pulldown" or "PullUp" instead, are the resistors built in to the Netduino or would I make an external circuit on my signal wire?

 

Also, is there a preferred resistormode to use?

 

Thanks,

Sean



#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 13 June 2015 - 05:41 PM

I don't think there is a preferred mode, it really depends upon what you are doing.

 

Take a simple switch circuit where closing the switch pulls the output high.  In this case I would be detecting say the transition from low to high, so rising edge.  In order to prevent the line from floating from ground when the switch is open I would use a pull down resistor.

 

In the reverse case where the switch pulls the line to ground I would be detecting falling edge and using a pull up resistor.

 

In both of these cases the resistor stops the line being in an undefined state, i.e. floating.

 

If the pin on the microcontroller was connected to another IC where the output was always either one of low or high then you may not need a resistor at all.

 

Hope this helps,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 Razvan

Razvan

    New Member

  • Members
  • Pip
  • 6 posts

Posted 14 June 2015 - 02:00 AM

Another question on the same subject is: When you choose PullUp value (for example) does this activate an internal pull up resistor or you're simply telling the processor 'hey I have connected a resistor between the pin and the Vcc' ?



#4 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 14 June 2015 - 05:41 AM

Should be internal pull up.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter





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.