I’m trying to get CAN communications working with my G120HDR Rev2 but can’t seem to get any output on the CAN pins. I’ve looked over the two other related posts with CAN timing and possibly dead ports, but they both seemed to just dry up about 5 months ago. Rather than throwing Thread Necro, I figured a fresh thread would be more useful.
I’ve successfully set/cleared the pins (P0_0, P0_1, P0_4, P0_5) using the following, so I don’t believe it’s blown those pins:
OutputPort port = new OutputPort(GHI.Hardware.G120.Pin.P0_1, false);
while (true)
{
port.Write(!port.Read());
Debug.Print("Pin P0.1: " + port.Read());
Thread.Sleep(100);
}
The really strange part is that the debugger falls down after a few dozen cycles of this, but the board keeps plugging away:
#### Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (1) ####
#### Message:
#### Bit_toggle.Program::Main [IP: 002c] ####
This is thrown at Thread.Sleep and happens completely at random.
Here’s what I’ve got for software:
Firmware 4.2.10
Latest .net and GHI libraries (4.3?)
Visual Studio 2012 Express
Win7 Enterprise x64
The only other thing I can come up with is that I need to manually set the registers to activate the CAN functionality on those pins…