Main Site Documentation

USB Host on FEZ Panda


#1

Hi.
I would like to know if it’s possible to use the USB Host feature, which is inside the LPC2387 onboard of the FEZ Panda.
If the diode, protecting the 5V power supply is removed, it is possible to power a USB device - but I haven’t been able to start a communication. Does the resistors and the “pull-up” enabler on D+ has something to do with this?
Or are the pull-down resistors, which are on the Domino, required?
Or should you disable the USB-debug feature first?

This is the code I’ve tried on the FEZ Panda, which deploys fine btw.


using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;

using GHIElectronics.NETMF.FEZ;

using System;
using System.IO;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.IO;
using GHIElectronics.NETMF.IO;
using GHIElectronics.NETMF.USBHost;


namespace FEZ_Panda_Application1
{
    public class Program
    {
        static bool ledState = false;

        static OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);

        public static void Main()
        {
            // Subscribe to RemovableMedia events
            //RemovableMedia.Insert += RemovableMedia_Insert;
            //RemovableMedia.Eject += RemovableMedia_Eject;

            // Subscribe to USB events
            USBHostController.DeviceConnectedEvent += DeviceConnectedEvent;
            // Sleep forever
            Thread.Sleep(Timeout.Infinite);
        }

        static void DeviceConnectedEvent(USBH_Device device)
        {
            if (device.TYPE == USBH_DeviceType.MassStorage)
            {
                //Debug.Print("USB Mass Storage detected...");
                //....
                //....
                ledState = !ledState;
                led.Write(ledState);
            }
        }

    }
}

Best Regards
Thomas Jespersen


#2

We just added support for this in SDK release yesterday! How did you know?!

Here a new blog post about this http://ghielectronics.blogspot.com/2011/03/usb-host-support-is-added-on-fez-panda.html


#3

This is so cool! Thanks!


#4

Great work! Thanks to all who added this feature. Really fantastic!


#5

Haha, I just know such things :wink:
Anyways, awesome work guys… I will start modifying a USB cable immidiately!


#6

Let us know how it went for you