TWhidden
Posts: 7
Joined: Fri Oct 02, 2015 4:25 pm

WinIoT - GPIO Controller - Can find 13 of the 15 supported

Fri Oct 02, 2015 4:37 pm

Hello all,

I have been using RP since day one. Running Mono under it for years with the original versions. I ported my source projects over to Windows Universal projects. The new GPIO controller API is fantastic.

That being said, I am able to get the controller to tell me what GPIO pins I am allowed to use with the following code:

Code: Select all

for (var i = 0; i < pinCount; i++)
            {
                GpioPin pin;
                GpioOpenStatus status;
                if (gpio.TryOpenPin(i, GpioSharingMode.Exclusive, out pin, out status))
                {
                    var supportsOutputMode = pin.IsDriveModeSupported(GpioPinDriveMode.Output);
                    if (supportsOutputMode)
                    {
                        _availablePins.Add(pin);                    // This is a pin we can use.
                        pin.SetDriveMode(GpioPinDriveMode.Output);  // We need this set to Output
                        pin.Write(GpioPinValue.Low);                // Init with a low value.
                        pin.DebounceTimeout = TimeSpan.Zero;        // Not all GPIO pins have this value set. 
                    }
                    
                }
            }
This works out great for me.

The issue I have is that the last 2 pins that are initialized for me, do not work. I am not completely sure what the physical pin numbers are on the GPIO header itself, but I know that I can control with WinIoT Apps 13 of the 15 reported ok for Driver mode OutPut.

Anyone else run into this?

Project on GitHub: https://github.com/TWhidden/HolidayShow

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: WinIoT - GPIO Controller - Can find 13 of the 15 support

Fri Oct 02, 2015 7:43 pm

The documentation says only 13 pins are available (mind only, I only count 12! - if you don't count the 2 LEDs.).

https://ms-iot.github.io/content/en-US/ ... gsRPi2.htm

Hardware interfaces for the Raspberry Pi 2 are exposed through the 40-pin header J8 on the board. Functionality includes:
•13x - GPIO pins
•2x - SPI buses
•1x - I2C bus
•2x - 5V power pins
•2x - 3.3V power pins
•8x - Ground pins
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

TWhidden
Posts: 7
Joined: Fri Oct 02, 2015 4:25 pm

Re: WinIoT - GPIO Controller - Can find 13 of the 15 support

Fri Oct 02, 2015 8:06 pm

I was able to get 13 out of it. I guess that is OK. I'll have to modify my physical environment to adapt for that. I guess I should have studied the physical documentation first before relying solely on the .net Controller.

Thanks for the clarification. I missed that detail when doing my initial research.

ricl
Posts: 657
Joined: Wed Aug 26, 2015 11:55 am

Re: WinIoT - GPIO Controller - Can find 13 of the 15 support

Sat Oct 03, 2015 9:44 am

See

https://github.com/ms-iot/content/commi ... 046dae52a7

which removes Header Pin 7/GPIO4 from the list which now makes it 12 GPIO pins rather than the 13 reported earlier.
ricl : F/gamma = ma : Law ii(a) : https://climatedatablog.wordpress.com/2016/01/02/an-energy-challenge-2016/ #AnEnergyChallenge2016

Return to “Windows 10 for IoT”