Helpful ReplyHot!Generic Touch Driver as a starting point for a XPT2046 driver?

Author
Volker
Senior Member
  • Total Posts : 142
  • Reward points : 0
  • Joined: 2007/01/29 03:00:06
  • Location: Germany
  • Status: offline
2018/03/02 01:18:20 (permalink)
0

Generic Touch Driver as a starting point for a XPT2046 driver?

Hi,
i have a touch display with an ssd1963 and a xpt2046 controller on it.
 
Now i need a driver for the xpt2046 with SPI communication.
 
What is the best starting point for the driver to use with aria?
 
Thanks!
#1
David
Super Member
  • Total Posts : 1249
  • Reward points : 0
  • Joined: 2007/12/17 23:19:53
  • Location: uk sussex
  • Status: online
Re: Generic Touch Driver as a starting point for a XPT2046 driver? 2018/03/02 08:04:42 (permalink)
0
http://www.microchip.com/forums/FindPost/1040038
post 25
post edited by David - 2018/03/02 08:05:44

David
I support http://picforum.ric323.com because this forum is often too broken to use!
#2
Michael.W.Mann
Super Member
  • Total Posts : 291
  • Reward points : 0
  • Joined: 2011/01/24 09:58:24
  • Location: Chandler, Arizona
  • Status: offline
Re: Generic Touch Driver as a starting point for a XPT2046 driver? 2018/03/02 15:08:02 (permalink) ☄ Helpfulby jiggoly 2018/03/08 13:01:03
0
Attached is an example of how to hack an existing Harmony driver.  It modifies a MTCH6303 touch driver in Harmony to support a Focal Tech FT5x06 driver.  While the Focal Tech uses an I2C command interface, instead of a SPI, it at least provides an example of where within Harmony to provide the touch (x,y) information so that the graphics stack can react correctly to a touch event.
 
The FT5x06, like most capacitive touch drivers, drives an interrupt pin low to alert the host that is a touch event.  The host responds by using the I2C command interface to read memory on the controller to retrieve the coordinates of the touch event.  Thus there is an interrupt service routine (ISR) in the code example that launches the query.  I'm not sure how your touch driver reports events.

Michael W. Mann
Principal Applications Engineer
MCU32 Applications, Microchip
#3
epareja
Super Member
  • Total Posts : 356
  • Reward points : 0
  • Joined: 2003/11/07 12:53:08
  • Location: Colombia
  • Status: offline
Re: Generic Touch Driver as a starting point for a XPT2046 driver? 2018/03/02 20:39:21 (permalink) ☄ Helpfulby Volker 2018/03/14 23:50:32
0
I modified the ADCTouch harmony driver and build an ADS7846 interface that is the same as the XPT2046. It can be configured using MHC. This driver uses SPI driver to comunicate with the touch controller.
I started the driver construction thinking my display has the ADS7843, but it had the XPT2046 so I implemented the Z pressure touch routine. 
It can be enabled in the configuration.
 
Hope it helps
 
post edited by epareja - 2018/03/03 06:13:35


Ernesto Pareja J
www.dcctrains.netne.net

#4
Volker
Senior Member
  • Total Posts : 142
  • Reward points : 0
  • Joined: 2007/01/29 03:00:06
  • Location: Germany
  • Status: offline
Re: Generic Touch Driver as a starting point for a XPT2046 driver? 2018/03/03 07:54:03 (permalink)
0
Thank you epareja, i'll take a look on it!
#5
jiggoly
Junior Member
  • Total Posts : 97
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: online
Re: Generic Touch Driver as a starting point for a XPT2046 driver? 2018/03/08 13:04:18 (permalink)
0
Michael, thanks for posting a working firmware for Focaltech Touch Panel. I can confirm it works even with FT5316. I was having hardtimes with the code to make it work as I stated in another post.
 
Thanks. Francisco.
#6
rpasc
New Users
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2018/06/04 06:44:54
  • Location: Portugal
  • Status: offline
Re: Generic Touch Driver as a starting point for a XPT2046 driver? 2018/06/05 01:50:18 (permalink) ☄ Helpfulby Freezessc 2018/06/05 13:08:01
0
Ernesto, thank you very much for your post and contribution with code.
I would like to add that the code required a minor modification (using MPLAB 4.15 and Harmony 2.05.01) in order for the touch service to correctly relay a PEN_UP state.
In file drv_ads7843.c.ftl, lines 850 and 925 (in functions GetX and GetY) were modified to : if((CalibMatrix.Divider != 0) && (xPosActual != -1) && (yPosActual !=-1)){
Thus sending -1,-1 when pen is up... it was a bit strange to find this after reading in the ar1021, line 669, that "/* set pen up state - (note if may be necessary to set coordinate to a valid position */"
 
#7
Jump to:
© 2018 APG vNext Commercial Version 4.5