This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am working with TCS2007 Touch driver ic which uses i2c protocol to communicate with my controller(Renesas s5d9) Based on touch IRQ was generated , i can able to read the TSC2007_MEASURE_TEMP0 and TSC2007_MEASURE_TEMP1 but i can't able to read the x,y position from the screen.
Any one can help me with this issue...
refer the command byte listed below
#define TSC2007_MEASURE_TEMP0 (0x0 << 4)
#define TSC2007_MEASURE_AUX (0x2 << 4)
#define TSC2007_MEASURE_TEMP1 (0x4 << 4)
#define TSC2007_ACTIVATE_XN (0x8 << 4)
#define TSC2007_ACTIVATE_YN (0x9 << 4)
#define TSC2007_ACTIVATE_YP_XN (0xa << 4)
#define TSC2007_SETUP (0xb << 4)
#define TSC2007_MEASURE_X (0xc << 4)
#define TSC2007_MEASURE_Y (0xd << 4)
#define TSC2007_MEASURE_Z1 (0xe << 4)
#define TSC2007_MEASURE_Z2 (0xf << 4)
#define TSC2007_POWER_OFF_IRQ_EN (0x0 << 2)
#define TSC2007_ADC_ON_IRQ_DIS0 (0x1 << 2)
#define TSC2007_ADC_OFF_IRQ_EN (0x2 << 2)
#define TSC2007_ADC_ON_IRQ_DIS1 (0x3 << 2)
#define TSC2007_12BIT (0x0 << 1)
#define TSC2007_8BIT (0x1 << 1)
#define MAX_12BIT ((1 << 12) - 1)
#define ADC_ON_12BIT (TSC2007_12BIT | TSC2007_ADC_ON_IRQ_DIS0)
#define READ_Y (ADC_ON_12BIT | TSC2007_MEASURE_Y)
#define READ_Z1 (ADC_ON_12BIT | TSC2007_MEASURE_Z1)
#define READ_Z2 (ADC_ON_12BIT | TSC2007_MEASURE_Z2)
#define READ_X (ADC_ON_12BIT | TSC2007_MEASURE_X)
#define PWRDOWN (TSC2007_12BIT | TSC2007_POWER_OFF_IRQ_EN)
Hello Vivek,
Unfortunately, we do not support driver issues. You may be able to find examples online that can help guide you.
Regards,
Aaron
Hi Aaron,
I can able to get the raw data of x,y positions (12 bit). I am using 800 x 480 pixel display.
for example
if i am touch one of the corner
data should be like any one of this value (0,0) or (800,480) or (0,480) or (800,0)
I am touching (left top)(164,3817)
x=164,
y=3817
I am getting values like this, Is there any formula to convert into my resolution.
I had verify with datasheet.
R_TOUCH =( ((RX−plate . XPosition) / 4096 ) ((4096 / Z1) -1)) - (RX−plate . (1-(YPosition/4096))
But i don't know about
RX−plate & RY−plate
can you please explain this formula.
Hello Vivek,
That formula is to calculate the Z coordinate. Sheet resistance is typically 300-400 ohms.
A calibration tool / library such as tslib is commonly used to deal with the mapping from the touch screen coordinates to the LCD coordinates.
Regards,
Aaron