More then 5 InterruptPort s - Netduino Plus 2 (and Netduino Plus 1) - Netduino Forums
   
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

More then 5 InterruptPort s

InterruptPort

  • Please log in to reply
3 replies to this topic

#1 p5315

p5315

    New Member

  • Members
  • Pip
  • 2 posts

Posted 19 December 2013 - 02:59 AM

Hi!

Im new tor the netduino comunity but i would like to know if there are only 5 InterruptPort available on the

netduino plus 2?

i have made a test program for the InterruptPorts since i need 6 of them.

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.Netduino;using Toolbox.NETMF.Hardware;namespace testinterupt.cs{    public class Program    {        static InterruptPort[] btn = new InterruptPort[6];        public static void Main()        {            btn[0] = new InterruptPort(Pins.GPIO_PIN_D4, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[0].OnInterrupt += ljud_OnInterrupt;            btn[1] = new InterruptPort(Pins.GPIO_PIN_D2, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[1].OnInterrupt += cinemaMode_OnInterrupt;            btn[2] = new InterruptPort(Pins.GPIO_PIN_A0, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[2].OnInterrupt += projector_OnInterrupt;            btn[3] = new InterruptPort(Pins.GPIO_PIN_D7, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[3].OnInterrupt += knobPuch_OnInterrupt;            btn[4] = new InterruptPort(Pins.GPIO_PIN_A2, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[4].OnInterrupt += knobPuch_OnInterrupt;            btn[5] = new InterruptPort(Pins.GPIO_PIN_A1, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);            btn[5].OnInterrupt += projector_OnInterrupt;            while (true)            {                Thread.Sleep(1000);                Debug.Print("main is alive");            }        }        public static void Knob_Rotated(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void ljud_OnInterrupt(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void cinemaMode_OnInterrupt(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void projector_OnInterrupt(uint Unused, uint value, DateTime Time)        {            Thread.Sleep(100);        }        public static void knobPuch_OnInterrupt(uint d, uint e, DateTime r)        {        }    }}

Thanks Simon



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 19 December 2013 - 06:49 AM

Hi Simon, Digital pins D2-D13 are all interrupt enabled, so you can run about 12 interrupts (plus the pushbutton) simultaneously. Chris

#3 p5315

p5315

    New Member

  • Members
  • Pip
  • 2 posts

Posted 19 December 2013 - 03:31 PM

So the pins A0-A5 dont have interrupt? Or only some of them?



#4 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 19 December 2013 - 04:48 PM

So the pins A0-A5 dont have interrupt? Or only some of them?

 

Pins A0 - A5 have interrupts - they have dual digital/analog functions, so if you create Input/Output/Tristate/InterruptPort they act as digital input/output, if you create AnalogInput they act as analog input. 







1 user(s) are reading this topic

0 members, 1 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.