Main Site Documentation

OutputPort Error


#1

When i try use the IO53, IO54 and IO55 like outputport the compiler inform: CLR_E_PIN_UNAVAILABLE

The USBIZI User manual inform on page 10 that the IO51 … IO60 are General purposes digital I/O

Some fix to this ?

code:

OutputPort LCD_Enable = new OutputPort((Cpu.Pin)USBIZI_IO.IO53, true);

while (true)
{
LCD_Enable.Write(true);
LCD_Enable.Write(false);
}

Compiler messages:

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.1\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.1\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\Microsoft .NET Micro Framework\v4.1\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\GHI Electronics\GHI NETMF v4.1 SDK\Assemblies\le\GHIElectronics.NETMF.System.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\GHI Electronics\GHI NETMF v4.1 SDK\Assemblies\le\FEZDomino_GHIElectronics.NETMF.FEZ.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files\GHI Electronics\GHI NETMF v4.1 SDK\Assemblies\le\GHIElectronics.NETMF.Hardware.dll’
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Users\Rafael\Desktop\Orbisonic AM Simples\Orbisonic AM Simples\Orbisonic AM Simples\bin\Debug\le\Orbisonic AM Simples.exe’, Symbols loaded.
The thread ‘’ (0x2) has exited with code 0 (0x0).
OI
#### Exception System.Exception - CLR_E_PIN_UNAVAILABLE (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
#### Microsoft.SPOT.Hardware.OutputPort::.ctor [IP: 0006] ####
#### MFConsoleApplication1.Program::Main [IP: 000e] ####
A first chance exception of type ‘System.Exception’ occurred in Microsoft.SPOT.Hardware.dll
An unhandled exception of type ‘System.Exception’ occurred in Microsoft.SPOT.Hardware.dll


#2

Try this code


using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.Hardware;

namespace FEZ_Panda_Application3
{
    public class Program
    {
        public static void Main()
        {
            OutputPort LCD_Enable = new OutputPort((Cpu.Pin)USBizi.Pin.IO53, true);

            while (true)
            {
                LCD_Enable.Write(true);
                LCD_Enable.Write(false);
            }


        }

    }
}

HTH.

-Rajesh


#3

Rajesh,

The compiler can not solve the “USBizi.Pin.IO53” declaration.

I create a new FEZ Panda Application to try execute your example.

On project i added the follow references:
GHIElectronics.NETMF.Hardware
Microsoft.SPOT.Hardare
Microsoft.SPOT.Native
mscorlib

What is necessary to include the “USBizi.Pin” ?

code:

using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.Hardware;

namespace FEZ_Panda_Application1
{
public class Program
{
public static void Main()
{
OutputPort LCD_ENABLE = new OutputPort((Cpu.Pin)[italic]USBizi.Pin.IO53[/italic], true);

        while (true)
        {
            LCD_ENABLE.Write(true);
            LCD_ENABLE.Write(false);
        }
    }

}

}


#4

Raf

Add a reference to

GHIElectronics.NETMF.Hardware.USBizi

…also get into the habit of using the code tag, the 101/010 image on top. This will made the code you post more readable.

HTH

-Rajesh


#5

Thanks Rajesh,

With the GHIElectronics.NETMF.Hardware.USBizi, now the IO53 its working.