How to use ADS7846 Driver for Touch panel?

Discuss Android on the Wandboard, as well as app development for or on the Wandboard.

How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Tue Jan 13, 2015 2:51 pm

Hi,
I found following line in .config file
Code: Select all
CONFIG_TOUCHSCREEN_ADS7846=y

So i attach ADS7846 TOUCH SCREEN CONTROLLER to extension board which used between LCD & Wandboard.
I use compiled Android 4.4.2 image which compile by following steps given in Readme file which given in wandboard source. No change in kernel or else where.
Where should i change for activating Touch functionality in wandboard?
i used command
Code: Select all
dumpsys input

i got info as below:-
Code: Select all
root@wandboard:/ # dumpsys input
INPUT MANAGER (dumpsys input)

Event Hub State:
  BuiltInKeyboardId: -2
  Devices:
    -1: Virtual
      Classes: 0x40000023
      Path: <virtual>
      Descriptor: a718a782d34bc767f4689c232d64d527998ea7fd
      Location:
      ControllerNumber: 0
      UniqueId: <virtual>
      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
      KeyLayoutFile: /system/usr/keylayout/Generic.kl
      KeyCharacterMapFile: /system/usr/keychars/Virtual.kcm
      ConfigurationFile:
      HaveKeyboardLayoutOverlay: false

Input Reader State:
  Device -1: Virtual
    Generation: 2
    IsExternal: false
    Sources: 0x00000301
    KeyboardType: 2
    Keyboard Input Mapper:
      Parameters:
        HasAssociatedDisplay: false
        OrientationAware: false
      KeyboardType: 2
      Orientation: 0
      KeyDowns: 0 keys currently down
      MetaState: 0x0
      DownTime: 0
  Configuration:
    ExcludedDeviceNames: []
    VirtualKeyQuietTime: 0.0ms
    PointerVelocityControlParameters: scale=1.000, lowThreshold=500.000, highThreshold=3000.000, acceleration=3.000
    WheelVelocityControlParameters: scale=1.000, lowThreshold=15.000, highThreshold=50.000, acceleration=4.000
    PointerGesture:
      Enabled: true
      QuietInterval: 100.0ms
      DragMinSwitchSpeed: 50.0px/s
      TapInterval: 150.0ms
      TapDragInterval: 300.0ms
      TapSlop: 20.0px
      MultitouchSettleInterval: 100.0ms
      MultitouchMinDistance: 15.0px
      SwipeTransitionAngleCosine: 0.3
      SwipeMaxWidthRatio: 0.2
      MovementSpeedRatio: 0.8
      ZoomSpeedRatio: 0.3

Input Dispatcher State:
  DispatchEnabled: 1
  DispatchFrozen: 0
  FocusedApplication: name='AppWindowToken{2cfa5550 token=Token{2cfa3900 ActivityRecord{2cfa3688 u0 com.android.launcher/com.android.las
  FocusedWindow: name='Window{2cfb5138 u0 Keyguard}'
  TouchDown: false
  TouchSplit: false
  TouchDeviceId: -1
  TouchSource: 0x00000000
  TouchDisplayId: -1
  TouchedWindows: <none>
  Windows:
    0: name='Window{2cf09db0 u0 SearchPanel}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceives
    1: name='Window{2cf54418 u0 NavigationBar}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceivs
    2: name='Window{2cd00ba0 u0 StatusBar}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys
    3: name='Window{2cfb5138 u0 Keyguard}', displayId=0, paused=false, hasFocus=true, hasWallpaper=false, visible=true, canReceiveKeys=s
    4: name='Window{2ceed0d0 u0 KeyguardScrim}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceis
    5: name='Window{2cf0bb60 u0 com.android.systemui.ImageWallpaper}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, vs
    6: name='Window{2cf0e178 u0 com.android.launcher/com.android.launcher2.Launcher}', displayId=0, paused=false, hasFocus=false, hasWas
  MonitoringChannels:
    0: 'WindowManager (server)'
  RecentQueue: length=2
    DeviceResetEvent(deviceId=-1), policyFlags=0x00000000, age=163719.6ms
    , age=163719.6ms
  PendingEvent: <none>
  InboundQueue: <empty>
  Connections:
    0: channelName='WindowManager (server)', windowName='monitor', status=NORMAL, monitor=true, inputPublisherBlocked=false
      OutboundQueue: <empty>
      WaitQueue: <empty>
    1: channelName='2ceed0d0 KeyguardScrim (server)', windowName='Window{2ceed0d0 u0 KeyguardScrim}', status=NORMAL, monitor=false, inpe
      OutboundQueue: <empty>
      WaitQueue: <empty>
    2: channelName='2cd00ba0 StatusBar (server)', windowName='Window{2cd00ba0 u0 StatusBar}', status=NORMAL, monitor=false, inputPublise
      OutboundQueue: <empty>
      WaitQueue: <empty>
    3: channelName='2cfb5138 Keyguard (server)', windowName='Window{2cfb5138 u0 Keyguard}', status=NORMAL, monitor=false, inputPublishee
      OutboundQueue: <empty>
      WaitQueue: <empty>
    4: channelName='2cf09db0 SearchPanel (server)', windowName='Window{2cf09db0 u0 SearchPanel}', status=NORMAL, monitor=false, inputPue
      OutboundQueue: <empty>
      WaitQueue: <empty>
    5: channelName='2cf54418 NavigationBar (server)', windowName='Window{2cf54418 u0 NavigationBar}', status=NORMAL, monitor=false, inpe
      OutboundQueue: <empty>
      WaitQueue: <empty>
    6: channelName='2cf0bb60 com.android.systemui.ImageWallpaper (server)', windowName='Window{2cf0bb60 u0 com.android.systemui.ImageWae
      OutboundQueue: <empty>
      WaitQueue: <empty>
    7: channelName='2cf0e178 com.android.launcher/com.android.launcher2.Launcher (server)', windowName='Window{2cf0e178 u0 com.android.e
      OutboundQueue: <empty>
      WaitQueue: <empty>
  AppSwitch: not pending
  Configuration:
    KeyRepeatDelay: 50.0ms
    KeyRepeatTimeout: 500.0ms
root@wandboard:/ #

I confuse about ads7846 usage in Android4.4.2 for Wandboard.
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am

Re: How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Tue Jan 27, 2015 11:27 am

Hi,
I am trying to use LCD which made by KYOCERA Industrial Ceramics Corporation - Display Division.
Product code is 'T-55343GD035JU-LW-AEN'
http://www.kyocera-display.com/products/partdetail.asp?PartNumber=T-55343GD035JU-LW-AEN

I found datasheet by following Link:-
http://www.kyocera-display.com/SiteImages/PartList/SPEC/T-55343GD035JU-LW-AEN%20final.pdf

For touch panel i use ADS7846 TOUCH SCREEN CONTROLLER which found at http://www.ti.com/product/ads7846,
By technical documentation http://www.ti.com/general/docs/lit/getliterature.tsp?genericPartNumber=ads7846&fileType=pdf
Its 16,14,12,15 no.pins i connect to Wandboard's Carrier boards JP4 11,7,9,13 respectively by using one custom extension PCB which used between Wandboard & LCD.

In uEnv.txt i use following lines:-
Code: Select all
bootargs_base=console=ttymxc0,115200 androidboot.console=ttymxc0 androidboot.hardware=freescale vmalloc=400M
video_mode=display0=dev=lcd0,timing=6500,240,120,1,1,320,1,2,1,if=RGB24,bpp=32 fbmem=12M
expansion=
baseboard=fairy


In kmesg/dmesg i found:-
Code: Select all
[    2.821407] _regulator_get: spi0.0 supply vcc not found, using dummy regulator
[    2.828980] ads7846 spi0.0: touchscreen, irq 357
[    2.834315] input: ADS7846 Touchscreen as /devices/platform/imx6q-ecspi.0/spi_master/spi0/spi0.0/input/input0
[    2.845174] isl29023 2-0044: standard operating mode
[    2.850341] isl29023_probe: failed!!
[    2.854018] isl29023: probe of 2-0044 failed with error -5
[    2.859763] i2c-core: driver [isl29023] using legacy suspend method
[    2.866123] i2c-core: driver [isl29023] using legacy resume method
[    2.872928] rtc-ds1307: probe of 2-0068 failed with error -5
[    2.878920] i2c /dev entries driver
[    2.883182] Linux video capture interface: v2.00
[    2.888219] mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video16
[    2.895945] mxc_v4l2_output mxc_v4l2_output.0: V4L2 device registered as video17
[    2.903694] usbcore: registered new interface driver uvcvideo
[    2.909594] USB Video Class driver (v1.1.0)
[    2.913915] mag3110 2-000e: check mag3110 chip ID
[    2.918888] mag3110 2-000e: read chip ID 0xfffffffb is not equal to 0xc4!
[    2.925778] mag3110: probe of 2-000e failed with error -22
[    2.931524] i2c-core: driver [mag3110] using legacy suspend method
[    2.937799] i2c-core: driver [mag3110] using legacy resume method
[    2.944326] imx2-wdt imx2-wdt.0: IMX2+ Watchdog Timer enabled. timeout=60s (nowayout=1)

i use dmupsys input in console then i got following result:-
Code: Select all
INPUT MANAGER (dumpsys input)

Event Hub State:
  BuiltInKeyboardId: -2
  Devices:
    -1: Virtual
      Classes: 0x40000023
      Path: <virtual>
      Descriptor: a718a782d34bc767f4689c232d64d527998ea7fd
      Location:
      ControllerNumber: 0
      UniqueId: <virtual>
      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
      KeyLayoutFile: /system/usr/keylayout/Generic.kl
      KeyCharacterMapFile: /system/usr/keychars/Virtual.kcm
      ConfigurationFile:
      HaveKeyboardLayoutOverlay: false
    1: ADS7846 Touchscreen
      Classes: 0x00000004
      Path: /dev/input/event0
      Descriptor: 3884a505979cfa619bf5f651236b85ce8a0dcc6c
      Location: spi0.0/input0
      ControllerNumber: 0
      UniqueId:
      Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
      KeyLayoutFile:
      KeyCharacterMapFile:
      ConfigurationFile: /system/usr/idc/ADS7846_Touchscreen.idc
      HaveKeyboardLayoutOverlay: false

Input Reader State:
  Device -1: Virtual
    Generation: 2
    IsExternal: false
    Sources: 0x00000301
    KeyboardType: 2
    Keyboard Input Mapper:
      Parameters:
        HasAssociatedDisplay: false
        OrientationAware: false
      KeyboardType: 2
      Orientation: 0
      KeyDowns: 0 keys currently down
      MetaState: 0x0
      DownTime: 0
  Device 1: ADS7846 Touchscreen
    Generation: 6
    IsExternal: false
    Sources: 0x00001002
    KeyboardType: 0
    Motion Ranges:
      X: source=0x00001002, min=0.000, max=239.000, flat=0.000, fuzz=0.000, resolution=0.000
      Y: source=0x00001002, min=0.000, max=319.000, flat=0.000, fuzz=0.000, resolution=0.000
      PRESSURE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000, resolution=0.000
    Touch Input Mapper:
      Parameters:
        GestureMode: spots
        DeviceType: touchScreen
        AssociatedDisplay: hasAssociatedDisplay=true, isExternal=false
        OrientationAware: true
      Raw Touch Axes:
        X: min=0, max=4095, flat=0, fuzz=0, resolution=0
        Y: min=0, max=4095, flat=0, fuzz=0, resolution=0
        Pressure: min=0, max=1024, flat=0, fuzz=0, resolution=0
        TouchMajor: unknown range
        TouchMinor: unknown range
        ToolMajor: unknown range
        ToolMinor: unknown range
        Orientation: unknown range
        Distance: unknown range
        TiltX: unknown range
        TiltY: unknown range
        TrackingId: unknown range
        Slot: unknown range
      Calibration:
        touch.size.calibration: none
        touch.pressure.calibration: physical
        touch.orientation.calibration: none
        touch.distance.calibration: none
        touch.coverage.calibration: none
      Viewport: displayId=0, orientation=0, logicalFrame=[0, 0, 240, 320], physicalFrame=[0, 0, 240, 320], deviceSize=[240, 320]
      SurfaceWidth: 240px
      SurfaceHeight: 320px
      SurfaceLeft: 0
      SurfaceTop: 0
      SurfaceOrientation: 0
      Translation and Scaling Factors:
        XTranslate: 0.000
        YTranslate: 0.000
        XScale: 0.059
        YScale: 0.078
        XPrecision: 17.067
        YPrecision: 12.800
        GeometricScale: 0.068
        PressureScale: 0.001
        SizeScale: 0.000
        OrientationScale: 0.000
        DistanceScale: 0.000
        HaveTilt: false
        TiltXCenter: 0.000
        TiltXScale: 0.000
        TiltYCenter: 0.000
        TiltYScale: 0.000
      Last Button State: 0x00000000
      Last Raw Touch: pointerCount=0
      Last Cooked Touch: pointerCount=0
  Configuration:
    ExcludedDeviceNames: []
    VirtualKeyQuietTime: 0.0ms
    PointerVelocityControlParameters: scale=1.000, lowThreshold=500.000, highThreshold=3000.000, acceleration=3.000
    WheelVelocityControlParameters: scale=1.000, lowThreshold=15.000, highThreshold=50.000, acceleration=4.000
    PointerGesture:
      Enabled: true
      QuietInterval: 100.0ms
      DragMinSwitchSpeed: 50.0px/s
      TapInterval: 150.0ms
      TapDragInterval: 300.0ms
      TapSlop: 20.0px
      MultitouchSettleInterval: 100.0ms
      MultitouchMinDistance: 15.0px
      SwipeTransitionAngleCosine: 0.3
      SwipeMaxWidthRatio: 0.2
      MovementSpeedRatio: 0.8
      ZoomSpeedRatio: 0.3

Input Dispatcher State:
  DispatchEnabled: 1
  DispatchFrozen: 0
  FocusedApplication: name='AppWindowToken{2c61a9d8 token=Token{2c618d28 ActivityRecord{2c618ab0 u0 com.android.launcher/com.android.las
  FocusedWindow: name='Window{2c654480 u0 Keyguard}'
  TouchDown: false
  TouchSplit: false
  TouchDeviceId: -1
  TouchSource: 0x00000000
  TouchDisplayId: -1
  TouchedWindows: <none>
  Windows:
    0: name='Window{2c64e310 u0 SearchPanel}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceives
    1: name='Window{2c64e5b0 u0 NavigationBar}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceivs
    2: name='Window{2c5869d8 u0 StatusBar}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys
    3: name='Window{2c654480 u0 Keyguard}', displayId=0, paused=false, hasFocus=true, hasWallpaper=false, visible=true, canReceiveKeys=s
    4: name='Window{2c5b1ad0 u0 KeyguardScrim}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceis
    5: name='Window{2c5ac8a8 u0 com.android.systemui.ImageWallpaper}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, vs
    6: name='Window{2c5d0908 u0 com.android.launcher/com.android.launcher2.Launcher}', displayId=0, paused=false, hasFocus=false, hasWas
  MonitoringChannels:
    0: 'WindowManager (server)'
  RecentQueue: length=4
    DeviceResetEvent(deviceId=-1), policyFlags=0x00000000, age=2469468.8ms
    DeviceResetEvent(deviceId=1), policyFlags=0x00000000, age=2469468.8ms
    , age=2469468.8ms
    DeviceResetEvent(deviceId=1), policyFlags=0x00000000, age=2468910.2ms
  PendingEvent: <none>
  InboundQueue: <empty>
  Connections:
    0: channelName='WindowManager (server)', windowName='monitor', status=NORMAL, monitor=true, inputPublisherBlocked=false
      OutboundQueue: <empty>
      WaitQueue: <empty>
    1: channelName='2c5b1ad0 KeyguardScrim (server)', windowName='Window{2c5b1ad0 u0 KeyguardScrim}', status=NORMAL, monitor=false, inpe
      OutboundQueue: <empty>
      WaitQueue: <empty>
    2: channelName='2c5869d8 StatusBar (server)', windowName='Window{2c5869d8 u0 StatusBar}', status=NORMAL, monitor=false, inputPublise
      OutboundQueue: <empty>
      WaitQueue: <empty>
    3: channelName='2c64e310 SearchPanel (server)', windowName='Window{2c64e310 u0 SearchPanel}', status=NORMAL, monitor=false, inputPue
      OutboundQueue: <empty>
      WaitQueue: <empty>
    4: channelName='2c64e5b0 NavigationBar (server)', windowName='Window{2c64e5b0 u0 NavigationBar}', status=NORMAL, monitor=false, inpe
      OutboundQueue: <empty>
      WaitQueue: <empty>
    5: channelName='2c654480 Keyguard (server)', windowName='Window{2c654480 u0 Keyguard}', status=NORMAL, monitor=false, inputPublishee
      OutboundQueue: <empty>
      WaitQueue: <empty>
    6: channelName='2c5ac8a8 com.android.systemui.ImageWallpaper (server)', windowName='Window{2c5ac8a8 u0 com.android.systemui.ImageWae
      OutboundQueue: <empty>
      WaitQueue: <empty>
    7: channelName='2c5d0908 com.android.launcher/com.android.launcher2.Launcher (server)', windowName='Window{2c5d0908 u0 com.android.e
      OutboundQueue: <empty>
      WaitQueue: <empty>
  AppSwitch: not pending
  Configuration:
    KeyRepeatDelay: 50.0ms
    KeyRepeatTimeout: 500.0ms

when try to find interrupts then
Code: Select all
                                       
           CPU0       CPU1       CPU2       CPU3       
 34:          0          0          0          0       GIC  sdma
 35:          0          0          0          0       GIC  VPU_JPG_IRQ
 37:          0          0          0          0       GIC  imx-ipuv3
 38:        373          0          0          0       GIC  imx-ipuv3
 39:          0          0          0          0       GIC  imx-ipuv3
 40:          0          0          0          0       GIC  imx-ipuv3
 41:       1199          0          0          0       GIC
 42:        515          0          0          0       GIC
 43:          1          0          0          0       GIC  galcore interrupt service for 2D
 44:          0          0          0          0       GIC  VPU_CODEC_IRQ
 50:          0          0          0          0       GIC  vdoa
 54:          0          0          0          0       GIC  mmc2
 55:       4879          0          0          0       GIC  mmc1
 56:       7492          0          0          0       GIC  mmc0
 58:       2348          0          0          0       GIC  IMX-uart
 63:         11          0          0          0       GIC  spi_imx
 64:          0          0          0          0       GIC  spi_imx
 68:          0          0          0          0       GIC  imx-i2c
 69:        474          0          0          0       GIC  imx-i2c
 70:          7          0          0          0       GIC  imx-i2c
 72:          0          0          0          0       GIC  usb_wakeup, fsl ehci pre interrupt, ehci_hcd:usb2
 75:          2          0          0          0       GIC  usb_wakeup, fsl-usb2-otg, fsl ehci pre interrupt, ehci_hcd:usb1, fsl-usb2-uc
 81:          0          0          0          0       GIC  THERMAL_ALARM_IRQ
 82:          0          0          0          0       GIC  asrc
 84:          0          0          0          0       GIC  spdif
 87:         11          0          0          0       GIC  i.MX Timer Tick
112:          0          0          0          0       GIC  imx2-wdt
121:          0          0          0          0       GIC  dvfs
139:          0          0          0          0       GIC  mmdc_1
144:          0          0          0          0       GIC  mmdc_1
145:          0          0          0          0       GIC  mmdc_1
146:          0          0          0          0       GIC  mmdc_1
150:       7879          0          0          0       GIC  enet
258:          0          0          0          0      GPIO  mmc2
329:          0          0          0          0      GPIO  mmc0
357:          0          0          0          0      GPIO  ads7846
IPI0:          0          0          0          0  Timer broadcast interrupts
IPI1:       5355       7168      13726       5507  Rescheduling interrupts
IPI2:          8          7          6          6  Function call interrupts
IPI3:       2481        560       2263       2637  Single function call interrupts
IPI4:          0          0          0          0  CPU stop interrupts
IPI5:          0          0          0          0  CPU backtrace
LOC:      14266      23953      14363       3788  Local timer interrupts
Err:          0

By powerdebug i found:-
Code: Select all
Gpio Tree :
***********
/
|-- gpio60 ( active_low:0, value:1 )
|-- gpio159 ( active_low:0, value:1 )
|-- gpio160 ( active_low:0, value:1 )
|-- gpio26 ( active_low:0, value:1 )
|-- gpio158 ( active_low:0, value:0 )
|-- gpio149 ( active_low:0, value:0 )
|-- gpio76 ( active_low:0, value:1 )
|-- gpio75 ( active_low:0, value:0 )
|-- gpio74 ( active_low:0, value:0 )
|-- gpio91 ( active_low:0, value:1 )
|-- gpio90 ( active_low:0, value:1 )
|-- gpio191 ( active_low:0, value:1 )
|-- gpio72 ( active_low:0, value:0 )
|-- gpio24 ( active_low:0, value:1 )
|-- gpio101 ( active_low:0, value:1 )
 `-- gpio200 ( active_low:0, value:1 )

But i know that some GPIO used as Externel GPIO as per following URL
http://wiki.wandboard.org/index.php/External_gpios

Now question remains at which pin(JP1/2/3/4) of wandboard's carrier board i should connect PENIRQ (11) pin of ADS7846.
What should i do so i got touch pannel working fine in Android4.4.2?
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am

Re: How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Thu Jan 29, 2015 1:26 pm

Hi,
I tried PENIRQ (11) pin of ADS7846 to JP4.4 pin which is GPIO75 as per powerdebug.
I change its 'edge' as 'falling'. But no use.

As i study,
http://forums.wandboard.org/viewtopic.php?t=723
1.How to as follows:-
1. Run ts_calibrate while booting.

2. In above link i found 4 more links related to how to calibrate touchscreen.
As per https://community.freescale.com/thread/300408
First, you must add calibration support in you TS drivers,....

This thing i dont know how to do?
As per compilation log which i collect by running command
Code: Select all
make --warn-undefined-variables -d -p -l

i got huge log which shows as follows:-
Code: Select all
Reading makefile `device/fsl/wandboard/BoardConfig.mk' (search path) (no ~ expansion)...

in that file there is no line shows in above link
TARGET_TS_CALIBRATION := true
TARGET_TS_DEVICE := "mxc_ts" // this is your touchscreen driver name

So as i am using ADS7846 TOUCH SCREEN CONTROLLER, i should use
Code: Select all
TARGET_TS_DEVICE := "ADS7846"    // this is your touchscreen driver name


3. In init.rc which in SD card which ported as Android4.4.2
i can see
Code: Select all
on boot                                                                             
# basic network init                                                                 
    ifup lo                                                                         
    hostname localhost                                                               
    domainname localdomain                                                           
                                                                                     
# set RLIMIT_NICE to allow priorities from 19 to -20                                 
    setrlimit 13 40 40

But as above link there should be as follows:-
Code: Select all
mkdir /data/system 0775 system system                                                                       
    exec /sbin/ts_calibrator

Should i add it before compile Android source or in running Android's init.rc?

but still not sure about steps...
My touchscreen not detected or my touch not detected in Android Wandboard till now.
Please help me.
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am

Re: How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Tue Feb 17, 2015 1:17 pm

Hi,
19 days ago from today i asked question but still no one try to answer, Why?
Is it not relevent question?
Waiting for some answer!
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am

Re: How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Fri Feb 20, 2015 12:52 pm

Some how i manage to get interrupt on GPIO 91 when i touch the touchpannel.
But do not know what is next step.
I done as following:-
1. after booting wandboard, in gpio91(PENIRQ pin of ads7846 connect to wandboard's carrier board's JP4.6 pin), change edge as 'falling'
2. run following command repeateadly
Code: Select all
cat value

When normal condition result is 1.
When touch condition result is 0.

I read various links some c program is needs to run for calibrate touch screen.
But for Android OS 4.4.2 kitkat where & which program or steps should i take so complete the process!
Now really help needed.
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am

Re: How to use ADS7846 Driver for Touch panel?

Postby Richard » Fri Feb 20, 2015 4:04 pm

Hello, khiremandar:

Actually, I'm not touch driver expert. :geek:
I read your post, and something needs to be figured out.
1. Could you see the interrupt count increases for ADS7846 under /proc/interrupts when you press the touch panel ?
e.g.
Code: Select all
cat /proc/interrupts
87:         11          0       GIC  i.MX Timer Tick
147:          0          0       GIC  mxc_hdmi
150:          2          0       GIC  enet
258:          0          0      GPIO  mmc2
280:          3          0      GPIO  ads7846


2. Could you get touch input event via "getevent" command?
https://community.freescale.com/thread/340094

3. If (1) and (2) items all work, it means the ADS7846 touch driver under linux partially works.
If your still can't see something change on your display when you press the touch panel, you need to add .idc file for android.

4. If (1), (2), (3) steps are all OK, then we can try to calibrate ADS7846 touch panel.
I think this is the most difficult part.



BR,

Richard
Richard
Site Admin
 
Posts: 137
Joined: Tue Dec 17, 2013 6:57 am

Re: How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Fri Feb 20, 2015 6:37 pm

Thanks Richard,
I got irq as you give example, but i not checked as you say,"increase when touch".
I not check getevent also.
But i got new information(new for me) that when i connect JP4.10 which has direction out & if we connect to ground then we can see setting button action(shows change wallpaper etc)
When we connect JP4.8 to ground then it works as Power button.
But both activate when i change uEnv.txt line
Code: Select all
expansion=

same as 'uEnv_wand_lcd_wvga_future_mt.txt' which given under setting folder in source folder.
At Monday i will check whole thing again as given line of action.
But still as you say
4. If (1), (2), (3) steps are all OK, then we can try to calibrate ADS7846 touch panel.
I think this is the most difficult part.

Same thought for me also.

Question:- PENIRQ pin of ads7846 where exactly i should connect or GPIO which given by wandboard as 'direction in' can i use?

There is no where proper steps for how to use touchscreen as installations steps given in Readme from wandboard.
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am

Re: How to use ADS7846 Driver for Touch panel?

Postby khiremandar » Tue Feb 24, 2015 5:18 am

Hi,
I attach PENIRQ pin of ads7846 to wandboard's carrier board's JP4.18 ie GPIO101.
As Richard's questions
1.
Could you see the interrupt count increases for ADS7846 under /proc/interrupts when you press the touch panel ?

I can see interrupt for ads7846 but it increases in CPI0 only.
Code: Select all
root@wandboard:/ # cat proc/interrupts                                         
           CPU0       CPU1       CPU2       CPU3       
357:          4          0          0          0      GPIO  ads7846

2.
Could you get touch input event via "getevent" command?

I tried commands as per given link & got result as follows:-
Code: Select all
root@wandboard:/ # getevent -lt /dev/input/event1
[      36.200609] EV_KEY       BTN_TOUCH            DOWN               
[      36.200615] EV_ABS       ABS_X                00001690           
[      36.200618] EV_ABS       ABS_Y                00001694           
[      36.200620] EV_ABS       ABS_PRESSURE         000003e4           
[      36.200622] EV_SYN       SYN_REPORT           00000000           
[      36.217161] EV_ABS       ABS_X                000016b1           
[      36.217165] EV_ABS       ABS_Y                000016b0           
[      36.217169] EV_SYN       SYN_REPORT           00000000           
[      36.250019] EV_KEY       BTN_TOUCH            UP                 
[      36.250022] EV_ABS       ABS_PRESSURE         00000000           
[      36.250024] EV_SYN       SYN_REPORT           00000000           


3.
If (1) and (2) items all work, it means the ADS7846 touch driver under linux partially works.
If your still can't see something change on your display when you press the touch panel, you need to add .idc file for android.


I found .idc at location
wand-4.4.2_1/out/target/product/wandboard/system/usr/idc/ADS7846_Touchscreen.idc
which has following lines:-
Code: Select all
touch.deviceType = touchScreen
touch.orientationAware = 1

touch.size.calibration = none
touch.orientation.calibration = none

I found this file in /system/usr/idc & same lines in that which i found in out folder's file.

I think after .idc file step, i can do most difficult part Calibarate ADS7846 touch panel. But for that also i need help.
Waiting for help!
khiremandar
 
Posts: 86
Joined: Wed Sep 03, 2014 11:38 am


Return to Software - Android

Who is online

Users browsing this forum: No registered users and 15 guests