FocalTech 7'' capacitive touchscreen panel not working properly with a20 android

Started by sqt, March 25, 2014, 10:58:20 AM

Previous topic - Next topic

sqt

I am working on a20 board with android loaded. I've connected FocalTech ft5302 driver IC for 7'' capacitive touchscreen and am using a13-LCD7 screen. When the touchscreen is connected to a20 board, only a part of the touchscreen is active  (which is about 5'' approx). No signal is generated on touching the rest of the area. The same capacitive touchscreen works fine if connected to an a13 board. I believe that I have connected all the pins correctly and the config in the sys_config.fex file is as given below

[ctp_para]
ctp_used            = 1
ctp_name            = "ft5x_ts"
ctp_twi_id          = 2
ctp_twi_addr        = 0x38
ctp_screen_max_x    = 800
ctp_screen_max_y    = 480
ctp_revert_x_flag   = 1
ctp_revert_y_flag   = 1
ctp_exchange_x_y_flag = 0

ctp_int_port        = port:PH21<6><default><default><default>
ctp_wakeup          = port:PB13<1><default><default><1>

.....

rtp_used = 0

I could not find the reason why the the touch screen behaves this way.

dave-at-axon

Do you have a serial debug connection?

If you do, type in dmesg and you'll see the debug output from the kernel. In there should be lines with:

report data:===x1 = 2,y1 = 3

with x1 and y1 being the touch number, 1 to 5. The 2 and 3 in my sample will be the coordinates passed to the kernel.

If you don't see anything, you'll need to increase the loglevel for them to show up. In this case it's set at level 4.

When the panel is initialised, it reports the digitisers max x and y coordinates to the kernel. The kernel then manages the mapping to the LCD resolution. On my cap panel is is 1500 x 900 that it reports and I believe the FT5x panels are preprogrammed at the factory so check that your panel is 800 x 480.

If you can check through dmesg, check the coordinates are this range and if they are higher then simply enter the x and y max values in the ctp_screen_max settings in the fex file and reboot. The FT5x drivers loads these and passes them to the kernel during the modules init call.


input_set_abs_params(input_dev,ABS_MT_POSITION_X, 0, SCREEN_MAX_X, 0, 0);
input_set_abs_params(input_dev,ABS_MT_POSITION_Y, 0, SCREEN_MAX_Y, 0, 0);


sqt

Thanks for your reply.

I checked the dmesg and found that the touch panel reports 800x480 max as expexted. However the maximum value x1=800 and y1=480 was reported at 5'' position. The rest of the area of touch panel does not respond.

Out of curiosity I changed the ctp_screen_max to 1024x800 and the max reported value became x1=1024 y1=800, but the active area remained unaltered.

Another thing I noticed that the touch panel still works even after the interrupt pin is disconnected. Now I wonder if its a hardware issue.

dave-at-axon

Quote from: sqt on March 26, 2014, 08:03:12 AM
Another thing I noticed that the touch panel still works even after the interrupt pin is disconnected. Now I wonder if its a hardware issue.

What level does the INT pin go to when you disconnect it?

The interrupt is set for TRIG_EDGE_NEGATIVE but I also see that it is configured to poll to device.

If you are building your own custom Android you can edit the ft5x.c file in the Linux kernel under drivers/input/sw_touchscreen and add some additional debugging output that will appear in dmesg.

sqt

I am sorry for the post above. I was leaving the wire connected to the TP-INT pin on the board. It seemed to be very noisy and probably that created the interrupts and that made the touchscreen working. Now that I've removed the wire completely, it does not behave that way. Sorry again for reporting falsely.

When I asked about the inactive touch panel problem to the allwinner supports team, they said that it would be because of some *.i file. I assumed that its in the driver code and found an ft_app.i file. I have no idea about what it does. Do you know about what it is  and how could it be helpfull?
Please help!
Thank you

dave-at-axon

Hi there,

According to the source, that is a firmware file for the FT5x. I've used an FT5x on a Newhaven TFT and it just worked out of the box. No need to calibrate it but then again it was pre-built with the LCD unlike your unit being supplied without.

Do you have a link to the datasheet for your panel?

Was it supplied to be used with a 7" 800x480 display? Just trying to determine if the panel is outputting the correct coordinates. It shouldn't matter too much as long as you inform the OS what the panel is using. It will then adjust to suit the LCD resolution.

dave-at-axon

I just discovered something in my system that may point to why you have an issue with your screen.

I was using a resistive touch panel before and legacy use left the pointercal file in the data directory. I had issues with trying to swipe down and after I ran a calibration I found that swipe now worked. I then tried a second test and deleted the pointercal file and found that my x direction was swapped. I had this inverted in the driver so I changed the fex file and re-installed.

I now have a working touch without any issues.

See if your system still has the pointercal file in data and if so, delete it and see how your display works.

sqt

I searched the everything but I could not find any file named pointercal.

sqt

I found the problem.
There was a setting in the menuconfig
CONFIG_INPUT_MOUSEDEV_SCREEN_X set to 1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y set to 768

I changed those to 800 and 480.
Now it works fine...

Thanks a lot for all your help.