SDK 2015 R1 pre release 3 SetTouchPins issue

I’ve encountered an issue when attempting to use the new Display.SetTouchPins function in the 2015 R1 - prerelease 3 SDK and I’m not sure if I’m just doing something dumb or making an undocumented assumption in the way this function is supposed to work with regards to other (such as Glide) touch functions.

I’ve got a custom board based on the G400-D module with a LCD/touch interface which is currently not using the default touch pins, which I understand are:

TYU = G400.Pin.PB12
TXL = G400.Pin.PB13
TYD = G400.Pin.PD1
TXR = G400.Pin.PD2

So, if I try and initialise the LCD touch using a custom set of pins and try to use one of the standard pins for something else, I get a CLR_E_FAIL exception when calling Glide.InitialiseTouch in the following code sample:


//returns true
Display.SetTouchPins(Cpu.AnalogChannel.ANALOG_0, (Cpu.AnalogChannel)9, G400.PB18, G400.PD2);
            
//omitting this line which forces the use of one of the default touch pins allows GlideTouch.Initialise() to succeed
OutputPort port = new OutputPort(G400.PD1, false);

Glide.SetScreenSize(480, 272);
Glide.FitToScreen = true;
GlideTouch.Initialize();

//this fails if GlideTouch.Initialise() succeeds
OutputPort port2 = new OutputPort(G400.PD1, false);

So it seems as if GlideTouch.Initialise is not using the pins set in the SetTouchPins call or am I missing something here?

@ AlexTZA - If you create the output port before initializing GlideTouch, can you toggle the pin and does it actually work as expected?

Hi John

I manually checked the port output voltage after I changed the code to the following and stepped through it :

Display.SetTouchPins(Cpu.AnalogChannel.ANALOG_0, (Cpu.AnalogChannel)9, G400.PB18, G400.PD2);
            
//omitting this default Raptor touch pin allows GlideTouch.Initialise() to succeed
OutputPort port = new OutputPort(G400.PD1, false);            
         
port.Write(true);
port.Write(false);

Glide.SetScreenSize(480, 272);
Glide.FitToScreen = true;
//exception here
GlideTouch.Initialize();

The voltage changes to 3.3V and back to 0V as expected.

@ AlexTZA - This should be fixed for the next pre-release.