Main Site Documentation

Is DebugInterface.Type reported affected by the MOD pin?


#1

Hi,

I am using a Cobra III and trying to detect at run-time whether the MOD pin is shorted to ground or not.

If I have the MOD pin shorted to ground, I can see that the board is not detected as G120 by Windows, so it is changing the debug interface from USB as expected. However, if I try and read DebugInterface.Type during run-time, it always reports 0 (USB) whether or not I short the MOD pin. Is the MOD pin simply a hardware over-ride and DebugInterface.Type only reports what the software would have done if it could?

If this is the case, does anyone have any suggestions on how I determine whether the MOD pin is shorted to ground and therefore the interface has switched from USB to Serial?

Thanks

Nick


#2

DebugInterface.Type only reports what was stored in config to alter the behavior of the MOD pin, it doesn’t report the state of MOD itself. To do that, you can create an OutputPort on the MOD pin and read it, assuming the pin is held in the same state and not released after startup.


#3

InputPort?


#4

Yes, InputPort, thanks.


#5

Thanks guys. Switched to reading it as an InputPort and works perfectly.

Cheers!

Nick