I’m having problems with InterruptPort. I’m prototyping touchscreen driver (STMP610 via I2C) before trasferring in native C++ code and I need INT signal from the touchscreen chip that is tied to PA0, but when I try to assign event function to the InterruptPort I get an exception. Any other port/pin works fine.
The firmware is compiled by me on FEZCerb base. I’ve no other reservation or peripheral defined on PA0 … for what I know.
public TouchScreen()
{
touch_int = new InterruptPort((Cpu.Pin) 0x00, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeHigh);
touch_int.OnInterrupt += touch_int_OnInterrupt; <-- Exception
//touch_int.ClearInterrupt();
touch_int.EnableInterrupt();
I2CDevice.Configuration i2c_config = new I2CDevice.Configuration( TouchAddress, 400 );
touchI2C = new I2CDevice(i2c_config);
}
static void touch_int_OnInterrupt(uint data1, uint data2, DateTime time)
{
// Touch interrupt
byte[] rbuff = I2CRead(0xd7, 4);
Debug.Print("Got Touch Interrupt!");
touch_int.ClearInterrupt();
}
///// Exception
Eccezione first-chance di tipo 'System.ArgumentException' in Microsoft.SPOT.Hardware.dll
Eccezione first-chance di tipo 'System.ArgumentException' in Microsoft.SPOT.Hardware.dll
Eccezione non gestita di tipo 'System.ArgumentException' in Microsoft.SPOT.Hardware.dll
What’s wrong ?