Hi,
I wasn't able to reproduce the same behavior with compiler STMPE610 Library routines.
I tested simple example from our compiler written for mikromedia Plus for PIC32MX7 and
only add reading of the X and Y coordinates inside Check_TP() routine (send coordinates over UART):
Code: Select all
void Check_TP() {
if (STMPE610_PressDetect()) {
// After a PRESS is detected read X-Y and convert it to Display dimensions space
if (STMPE610_GetLastCoordinates(&Xcoord, &Ycoord) == 0) {
Process_TP_Press(Xcoord, Ycoord);
if (PenDown == 0) {
PenDown = 1;
Process_TP_Down(Xcoord, Ycoord);
}
}
}
else if (PenDown == 1) {
PenDown = 0;
Process_TP_Up(Xcoord, Ycoord);
}
}
Also, please, take a look at STMPE610_Config() routine in the example:
Code: Select all
char STMPE610_Config() {
STMPE610_SetI2CAddress(STMPE610_I2C_ADDR1);
if(STMPE610_IsOperational()) {
return STMPE610_IO_NOT_OPERATIONAL;
}
STMPE610_Reset();
STMPE610_Module(STMPE610_MODULE_TS | STMPE610_MODULE_ADC, STMPE610_ENABLE);
STMPE610_AlternateFunction(STMPE610_GPIO_PIN1, STMPE610_ENABLE);
STMPE610_SetGPIOPin(STMPE610_GPIO_PIN1, 0); // IN1 to "0" -> I2C communication
STMPE610_SetSize(480,272);
STMPE610_Module(STMPE610_MODULE_TS | STMPE610_MODULE_ADC, STMPE610_ENABLE);
STMPE610_EnableInterrupt(0, STMPE610_ENABLE);
STMPE610_ConfigureInterrupt(STMPE610_INT_POLARITY_ACTIVE_HIGH | STMPE610_INT_TYPE_EDGE | STMPE610_INT_ENABLE_ALL);
STMPE610_SetADC(STMPE610_ADC_CTRL1_SAMPLETIME_56 | STMPE610_ADC_CTRL1_ADC_12BIT | STMPE610_ADC_CTRL1_INT_REFERENCE);
Delay_10ms(); Delay_10ms();
STMPE610_SetADCClock(STMPE610_ADC_CTRL2_3250_kHZ);
STMPE610_AlternateFunction(STMPE610_GPIO_PIN4 | STMPE610_GPIO_PIN5 | STMPE610_GPIO_PIN6 | STMPE610_GPIO_PIN7, STMPE610_DISABLE);
STMPE610_ConfigureTSC(STMPE610_TSC_CFG_AVE_CTRL_4S, STMPE610_TSC_CFG_TOUCH_DET_DELAY_500uS, STMPE610_TSC_CFG_TOUCH_SETTLING_1mS);
STMPE610_SetFIFOThreshold(1);
STMPE610_ResetFIFO();
STMPE610_TSIDrive(STMPE610_TSC_I_DRIVE_20mA);
STMPE610_TSControl(STMPE610_TSC_CTRL_TRACK0 | STMPE610_TSC_CTRL_ACQU_XYZ | STMPE610_TSC_CTRL_ENABLE);
STMPE610_ZDataFraction(STMPE610_FRACP4_WHOLP4);
STMPE610_SetTouchPressureThreshold(45);
STMPE610_ClearInterrupts();
STMPE610_WriteReg(STMPE610_INT_CTRL_REG, 0x01);
return STMPE610_OK;
}
Best regards,
Marina