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 GPIO pins


  • Please log in to reply
4 replies to this topic

#1 Jeka

Jeka

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 13 December 2011 - 08:44 PM

Hello. Where i have to see to revive and make available not available ports (in schematics i see port 90 is avalible on board, but unused.

This code give me ArgumentException at OutputPort constructor:

public const Cpu.Pin GPIO_PIN_UNSPECIFIED = (Cpu.Pin)90;

        public static void Main()
        {
            // write your code here
            OutputPort op = new OutputPort(GPIO_PIN_UNSPECIFIED, false);

            while (true)
            {
                op.Write(true);
                Thread.Sleep(1000);
                op.Write(false);
                Thread.Sleep(1000);
            }

        }

I'm ready to change netduino firmware code and .netmf sources to do this code working.

For what this? I need my board based on this platform but i need changes for more gpio ports.

#2 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 13 December 2011 - 08:48 PM

The Cpu.Pin enumeration specifies GPIO port pins, not physical package leads. The microcontroller has two ports PA (PA0 = 0, PA1 = 1, ..., PA31 = 31) and PB (PB0 = 32, PB1 = 33, ...), so you'd need to specify the number of PA6 pin (which is connected to package lead 90), that is (Cpu.Pin)6.

#3 Jeka

Jeka

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 13 December 2011 - 09:00 PM

Oh, thanks, i'll try it. But i think will be more questions =))

#4 Jeka

Jeka

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts

Posted 13 December 2011 - 09:07 PM

So, how access to AD6 AD7? (not avalible 2 analog inputs)

#5 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 14 December 2011 - 07:47 AM

So, how access to AD6 AD7? (not avalible 2 analog inputs)

It depends on the Netduino firmware version. In 4.1.x you'd need to modify the native code of SecretLabs.NETMF.Hardware.AnalogInput class, i.e. add handling of AD6,AD7 channels because it supports only analog channels multiplexed with I/O (AD0 - AD3) and AD4, AD5 (special case, internally multiplexed with I2C signal lines). In 4.2.x the A/D interface has been unified - it is now part of the .NET MF core implementation - and you should be able to use the new Cpu.AnalogChannel enumeration. Please note the Netduino 4.2.x firmware is under development, it does not yet implement this new analog input interface.




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.