HID Device crashing Unity - Microchip dsPIC33E

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!

1838733–117923–Sensors.cs (617 Bytes)

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.

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: HID Device crashing Unity - Microchip dsPIC33E - Unity Engine - Unity Discussions

2113219–138656–HidDllDrt.zip (83.5 KB)

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/