XMEGA Touchscreen Controller

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I'm planning on using an ATxmega128A1U in a system that will feature an LCD touchscreen, and I'll be prototyping said system with an XMEGA A1U Xplained Pro, and this is the touchscreen I'm going to be using, which will be connected to solder-less breadboard, which will be connected to the Xplained via jumpers. I'll be running the Xmega at 32MHz, and I'll be using AS7 (v7.0.118), but I have a few questions regarding both the Xmega ADC and the Xplained board...

 

The touchscreen is a 4-wire resistive type, and after reading AVR341 I feel fairly confident about implementing touchscreen control in this way (4 GPIO pins, 2 of which will be configured as ADC inputs during the actual scanning process) however AREF cannot exceed Vcc - 0.6V (Vcc being 3.3V, so 2.7V), meaning I could potentially not be able to read touches in certain areas. My first thought to get around this was to use the DAC to get my 2.7V, swapping the pins connected to X- and Y- between DAC and ADC inputs to read X and Y co-ordinates, however I'm curious if this will have much of an effect on the speed at which I can read touches? Does anyone know of a better and/ or easier way of getting around this? After all I'm sure I'm not the first person to use an XMEGA as a touchscreen controller!

I do have a resistive touch screen controller with an I2C interface, maybe that would be a better way to go? If possible I would like to interface the touchscreen directly though as it's cheaper...

 

My second question remains on the topic of ADC reference voltage. One of the headers (Ext1) gives the user access to PA0 which can be used as AREF, however looking at the schematic there are no decoupling capacitor(s) on either of the two pins that can be used as AREF, and the schematic checklist recommends having a 100nF cap as close to the AREF pin as possible, and also using a 4.7uF cap too...

 

 

 

So essentially what I'm asking is how important is it to follow these guidelines? If I connect a voltage to PA0 via Ext1 (with a 100nF and a 4.7uF) am I likely to experience any issues with the ADC seeing there is no 100nF close to the actual pin, not to mention the length of PCB trace between the Xmega and the extension header (and the jumper wire!) or will it just be a case of the ADC not being quite as accurate as it could be if the guidelines were followed?... Or is there something already on-board for AREF that I've simply overlooked/ not seen?

 

Thanks in advance for any feedback,

Howard

Last Edited: Wed. Nov 16, 2016 - 08:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

VERY important or your program will think the user is touching the screen randomly all around. Also remember: the ADC can't measure anything higher than the reference voltage and the reference can't be higher than 0.6v less than VCC. This gives you a dead area along the "top" and "side" of the LCD. Perhaps you want to look into a chip like STMPE811 to interface your xMega to the touch screen.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:

the ADC can't measure anything higher than the reference voltage and the reference can't be higher than 0.6v less than VCC. This gives you a dead area along the "top" and "side" of the LCD. 

 

That's what I was referring to when I mentioned using a DAC; since AREF will be 2.7V, it'd be no good using standard outputs to scan as that would set 2 of the lines to 3.3V, resulting in the dead area as you said. I was thinking that if I use the DAC to set the two lines required to be driven high, to 2.7V instead I could get around this, my only concern was speed.

 

In truth I think you're right about using a touchscreen controller chip, I've got a breakout board with an STMPE610 somewhere so I'll try that out. I suppose another option would be to go back to a Mega, but I'd rather not half fCpu and lose DMA and the event system...

Going further though, the STMPE610 is obsolete according to Mouser, where as I see the chip you suggested, the STMPE811, is still in production, but what seems strange is that ST themselves don't seem to list any product information on either of the devices? The only way I could find datasheets was through distros, any ideas why ST aren't providing such info?

 

Edit: typos

Last Edited: Wed. Nov 16, 2016 - 03:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why would you want to go back to a mega?

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was thinking out loud so to speak, I was referring to the ADC on the Mega's that feature a max AREF voltage of Vcc, but I'm I'm 95% sure I'm gunna go with an external touchscreen controller with an Xmega, ideally the device you suggested as I have one very similar to it on a breakout board as I mentioned in my last post, I'm just trying to figure out why there's no info on the device on ST's website, slightly concerned ST might be about to EOL it...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I never built this, but I once considered using 1 or 2 diodes to develop the reference voltage from AVCC and to power the top and right sides of the touch screen. Perhaps diodes in series with output pins so you can turn off the voltage to the touch screen for measuring the perpendicular direction.

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Howard_Smith wrote:
I do have a resistive touch screen controller with an I2C interface, maybe that would be a better way to go? If possible I would like to interface the touchscreen directly though as it's cheaper...
Indeed less expensive yet still relatively reliable.

The following is half the LCD resolution and double the price of the Adafruit module :

Precision Design Associates

28xx Series - 2.8in Projected Capacitance Touch

2.8in Touch Module - Xplained

http://www.pdaatl.com/tx28xx.htm#tm2800

2.8in Touch Module for use with Atmel Xplained kits or custom hosts with the necessary interfaces and I/O to communicate with the touch controller and display hardware.

...

Demo HEX Files for XMEGA-A3BU and SAM4S Xplained MCU boards. Source available from the Atmel Software Framework.

...

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Howard_Smith wrote:
In truth I think you're right about using a touchscreen controller chip, I've got a breakout board with an STMPE610 somewhere so I'll try that out. ...
Could consider a resistive touchscreen controller from a ST competitor.

http://www.microchip.com/wwwproducts/en/en557224 (AR1021)

In SOIC so it's easy to prototype.

It's a part of

4D Systems

uLCD-43D

http://www.4dsystems.com.au/product/uLCD_43D/

(datasheet, page 21, top middle)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Howard_Smith wrote:
I suppose another option would be to go back to a Mega, but ...
A tiny24A has multiple differential ADC channels and is less expensive than some resistive touch controllers.

Multiple tinyAVR also have a QTouch capability for touch buttons on the sides (when no more room on a small display for touch buttons).

http://www.atmel.com/devices/ATTINY24A.aspx

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the suggestions gchapman, plenty for me to look into! 

 

gchapman wrote:

Could consider a resistive touchscreen controller from a ST competitor.

http://www.microchip.com/wwwproducts/en/en557224 (AR1021)

In SOIC so it's easy to prototype.

It's a part of

4D Systems

uLCD-43D

http://www.4dsystems.com.au/product/uLCD_43D/

(datasheet, page 21, top middle)

 

I searched for hours trying to find such a device that wasn't a QFN ha! So again, thank you!

 

gchapman wrote:
A tiny24A has multiple differential ADC channels and is less expensive than some resistive touch controllers.

 

Again, nice idea, especially given the QTouch capability. I'll look at pricing for the chip you suggested, and a Tiny, as well as some more resistive touchscreen controllers. Depending on just how much cheaper the Tiny route would be I might just opt for that solution. Either way - resistive touchscreen controller or a Tiny (or even something else entirely), you've given me enough to go on and 'get the ball rolling' so to speak, so thank you for your input gchapman and Torby.