Main Site Documentation

Unable to use the IO60P16 with Spider I


#1

Guys,

first of all, have a happy new year!
I am fighting a lot to get the IO60P16 working, with no success.

It seems I am using a wrong driver, because I am not able to run the examples I found searching the forum.

For example, my driver seems not to have the io60p16.CreateInterruptPort method.

Furthermore, the constructors new IO60P16.PWM, new IO60P16.OutputPort, new IO60P16.InputPort do not accept two arguments.

Attached you can find some screenshots.

Any idea?
My target is to start using 5 interrupt ports.

Thanks!

Stefano


#2

Could you post your Program.generated.cs file and a short example program that shows the problem?


#3

Hi John,

thank you for your answer. This is the program.generated.cs file.


//------------------------------------------------------------------------------
// <auto-generated>
//     Il codice è stato generato da uno strumento.
//     Versione runtime:4.0.30319.296
//
//     Le modifiche apportate a questo file possono provocare un comportamento non corretto e andranno perse se
//     il codice viene rigenerato.
// </auto-generated>
//------------------------------------------------------------------------------

namespace GadgeteerApp1 {
    using Gadgeteer;
    using GTM = Gadgeteer.Modules;
    
    
    public partial class Program : Gadgeteer.Program {
        
        private Gadgeteer.Modules.GHIElectronics.SDCard sdCard;
        
        private Gadgeteer.Modules.GHIElectronics.UsbClientDP usbClientDP;
        
        private Gadgeteer.Modules.GHIElectronics.Extender extender;
        
        private Gadgeteer.Modules.GHIElectronics.Ethernet_J11D ethernet_J11D;
        
        private Gadgeteer.Modules.GHIElectronics.IO60P16 io60p16;
        
        private Gadgeteer.Modules.Seeed.CellularRadio cellularRadio;
        
        public static void Main() {
            // Important to initialize the Mainboard first
            Program.Mainboard = new GHIElectronics.Gadgeteer.FEZSpider();
            Program p = new Program();
            p.InitializeModules();
            p.ProgramStarted();
            // Starts Dispatcher
            p.Run();
        }
        
        private void InitializeModules() {
            this.usbClientDP = new GTM.GHIElectronics.UsbClientDP(1);
            this.cellularRadio = new GTM.Seeed.CellularRadio(4);
            this.sdCard = new GTM.GHIElectronics.SDCard(5);
            this.ethernet_J11D = new GTM.GHIElectronics.Ethernet_J11D(7);
            this.extender = new GTM.GHIElectronics.Extender(11);
            this.io60p16 = new GTM.GHIElectronics.IO60P16(14);
        }
    }
}


These are the includes:


using System;
using System.Collections;
using System.Threading;
using System.IO;
using System.Xml;

using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Microsoft.SPOT.Net.NetworkInformation;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using GHI.Premium.Net;
using System.Text;
using GHI.Premium.Hardware;

And these is the code I am not able to compile:


IO60P16.OutputPort io60p16_outport;        
IO60P16.InputPort io60p16_inport;        
IO60P16.PWM io60p16_pwm;
io60p16_pwm = new IO60P16.PWM(IO60P16.PWMPin.PWM0, IO60P16.PWM.TickWidth.TickWidth_32KHz_31520ns);
io60p16_outport = new IO60P16.OutputPort(IO60P16.IOPin.Port1_Pin7, false);
io60p16_inport = new IO60P16.InputPort(IO60P16.IOPin.Port1_Pin6, IO60P16.ResistorMode.ResistivePullUp);

The error is something like this (translated from italian):

‘Gadgeteer.Modules.GHIElectronics.IO60P16.InputPort’ does not contain a constructor that accepts two arguments.

The same is for the other two constructors.

Best regards,

Stefano


#4

It sounds like you are looking at examples based on my driver instead of GHI’s.


#5

It looks like your constructors are missing the first parameter. The signature for our input port is:

public InputPort(IO60P16 io60p16, IOPin pin, ResistorMode resisterMode)

Try passing the io60 module instance in as the first parameter, that should work.


#6

Gosh! :-[
I read all the topics regarding this module and I did not realize that there are two different drivers. I thought there was only one driver in different versions!

Thank you to specify this.

Is the GHI’s driver able to handle interrupt?

Regards,

Stefano


#7

No, I don’t believe they have ever added this capability. My driver has it but I’ll warn you that this module has been nothing but a headache for almost everyone that has tried to use it.

You can get my driver here if you want to try it out:


#8

It is however the BEST driver available.

I can vouch for the headache. I bought it thinking it was the perfect answer to my project, only to find out it was useless to me.

Ended up with the PulseInPulseOut.

Two purchases for one project. :frowning:


#9

Thanks.


#10

Guys,

thank you all for your answers. I will try to use the ianlee74 driver during this week and will be back to you.

I need to handle 5 interrupts and I hope I will be able to do this with the IO60P16.

If not, I will use an old Rhyno to handle the interrupts and I will try to make the spider and the rhyno talking together.

:smiley:


#11

The DL40 is another very good option.


#12

If you do decide to pursue the DL40 route, I have a DL40 IO firmware that you can load onto the DL40 and a corresponding NETMF module driver, this gives you the ability to create interrupt pins, input/output pins, analog pins and PWN pins all from managed code on .NETMF. A few others in these forums have used it with success for handling interrupts, the nice thing with the DL40 is that all the pins can have interrupts so there is no shortage there.

Source : dl40io.codeplex.com
Latest Binaries : https://www.ghielectronics.com/community/codeshare/entry/633


#13

Hello,

finally I bought a DL40 because it is smaller than the IO60P16.

Taylorza, I tried your driver but it seems I am no able to use it: :-[

This is the code I’am using:

   

DLIOModule DL40 = new DLIOModule(10);

IInterruptPin InterruptPin1 = DL40.CreateInterruptPin(1, 1, Microsoft.SPOT.Hardware.Port.ResistorMode.PullUp, Microsoft.SPOT.Hardware.Port.InterruptMode.InterruptEdgeBoth);
       
InterruptPin1.Interrupt += new PinInterruptHandler(Pin_Interrupt1);

 void Pin_Interrupt1(IInterruptPin pin, uint interruptCount)
       {
           Debug.Print("Interrupt raised");
       }

When I put the P1.1 to ground, nothing happens.

Is it necessary to flash the DL40 firmare to use it?

Thanks!

Stefano.


#14

@ SteZab - Yes, you need to load the firmware on the DL40. You can get all the latest binaries on code share.


#15

Hello,

I started a new topic regarding the DL40.

https://www.ghielectronics.com/community/forum/topic?id=14747

Regards,

Stefano.