Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

HID Device crashing Unity - Microchip dsPIC33E

Discussion in 'Editor & General Support' started by plimph, Nov 6, 2014.

  1. plimph

    plimph

    Joined:
    Jan 23, 2014
    Posts:
    4
    Hi -

    I have a HID device that I have made using a Microchip dsPIC33E. I modified a dll in C# to suit my microprocessor and needs and it works fine in the XNA app that I made (also C#), but I can not make it work in Unity without crashing.

    I'm also getting the error
    <RI.Hid> Device is not supported: DRT HID (65280, 0x0001).
    But I've read that this happens a lot without effecting functionality. Tried downloading the free trial of Unity Pro as was suggested in other threads, but it behaves the same.

    The basic XNA app takes in values from 9 analog sensors and uses these values both in gameplay and to activate lights and trip mechanical devices to operate in real-life.

    Right now, I have scaled down the Unity code to just display the sensor values using only one piece of script (and the dll). It works fine in the editor on the first run, but freezes Unity completely upon the next run. Need to go to Task Manager and End Task.

    Posting the single, simple Unity script here, which I attached to the Main Camera. Unfortunately, I'm not allowed to post the dll I'm using because it is not an allowed file extension for this site. Can post the source code for it if anyone is interested.

    Any help is appreciated!
     

    Attached Files:

  2. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,489
    You can zip it and post that.

    There's nothing about the CS code that would cause it to crash on restart, although I'd recommend doing your field inits in Awake(). DLL source would be more useful.
     
    Last edited: Nov 6, 2014
  3. happybot

    happybot

    Joined:
    Dec 15, 2014
    Posts:
    4

    Attached Files:

  4. happybot

    happybot

    Joined:
    Dec 15, 2014
    Posts:
    4

    Sorry - couldn't find this post and just posted a new one. Got off this project for a while, but back on it now. I'll post the DLL source now, but the other thread is here: http://forum.unity3d.com/threads/hid-device-crashing-unity-microchip-dspic33e.278611/