Simple example for touch sensors

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

I've noticed that the ATtiny1614 can also read touch sensors with no external components. The idea is to connect a piece of metal (possibly isolated to protect against ESD) with one of the MCU pins and simply touch it with your finger to trigger an input. Unfortunately I wasn't able to find out how to use this. The main datasheet doesn't say much about this and just refers to Atmel Start. There is an example for a different model only which I could download and open in Atmel Studio. It contains tons of code (compiling to 7 kB binary size) and also custom static library files for the tiny817 which probably won't work on my hardware.

 

In one of the files in the project, there was a link to another PDF document that tries to explain how to use all of this. Again, it reads like it's infinitely complicated to get this up and running. When I create a new project in Atmel Start, for my model, with one touch button, and try to export it, it simply fails with no reason ("failed generating the project"). Seems like that wizard won't help me.

 

So I'm looking for the simplest possible example to drive a single self-capacitance touch button with minimal code. Can anybody please help me with that? The web doesn't offer me anything about this. For now, I'm not interested in any of the fancy 2D slider or proximity stuff the docs talk about. And if that requires another year of studying, I can live without it.

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

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

No, it doesn't help. The short video doesn't tell me anything new, the contained URL is not working anymore and the links on the page itself also don't explain me what I should do, except that I should use Atmel Start, somehow, if it would work. Also, the download links in the referenced article require some login that I don't have. So nothing in it for me.

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

a number of years ago there was a Qtouch plug-in in studio and even an external tool that you could use to configure your touch system.

I have not used it in a large number of years, so do not know how it all progressed, but back then they were working on full integration in Atmel Studio I would expect that to have been completed as in the years after I ' played'  with it studio has gone from 5 to 7.....

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

There is a Cap Touch forum:  https://community.atmel.com/capacitive-touch - but there doesn't seem to be much activity there.

 

frown

 

If this is for a commercial project, I'd suggest contacting your FAE or Distributor ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ygoe wrote:
hen I create a new project in Atmel Start, for my model, with one touch button, and try to export it, it simply fails with no reason ("failed generating the project").
At the very least does the "view sourcecode" option work ?

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

clawson wrote:

ygoe wrote:
hen I create a new project in Atmel Start, for my model, with one touch button, and try to export it, it simply fails with no reason ("failed generating the project").
At the very least does the "view source code" option work ?

 

something is going on in the Atmel Start / ASF department. start intermittent not working, ASF intermittent not working giving strange errors.

There is another thread on this but could not find it quickly.

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

awneil wrote:

There is a Cap Touch forum:  https://community.atmel.com/capacitive-touch - but there doesn't seem to be much activity there.

 

Yeah, that forum is dead. But why am I logged in there with my account from avrfreaks.net? Do they share the forum database and authentication cookies across domains?

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

clawson wrote:

At the very least does the "view sourcecode" option work ?

 

Yes, that gives me a tree of source files that I can browse. But the binary libraries are not shown here so it's of no big use. And still, that generated project looks like full of bloatware. It's so huge that I'm wondering how the other demo can be compiled into only 8 kB size. Considering that my existing project already has around 5 kB (with a plain button switch incl. debouncing instead of touch), it's going to be hard to fit the entire project into that tiny MCU.

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

ygoe wrote:
Do they share the forum database and authentication cookies across domains?

Yes - we're all just one big, happy family!

 

laugh

 

https://community.atmel.com/comm...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ygoe wrote:
It's so huge that I'm wondering how the other demo can be compiled into only 8 kB size

It's a lot of source because the source  covers every eventuality - but not all of that source will be used in any one project ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are sample project here:

 

https://start.atmel.com/#example...

 

I loaded the one for a ATtiny817, which worked out fo the box.  

 

I am new to Studio 7, but it compiled and ran on a Tiny817 Xmini kit.

James

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

I know that sample. But it's far from simple. And not for the hardware I have. That code generator has failed to do something for my hardware so I can't make any use of it.

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

From here (https://start.atmel.com/#), you can "Create new project" for the AVR you are using, select the middleware etc you need, and export the files.  The code seems vast and opaque, but somehow works and is small.

James

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

From what I can understand, the documentation is here:  https://www.microchip.com/developmenttools/ProductDetails/atmel%20qtouch%20library

I browsed through the documents, and the library headers from the Start examples, and concluded that them most important and up to date document is "QTouch® Modular Library Peripheral Touch Controller User's Guide".

The simplest, and I think minimal requirement, is the "acquisition module without auto-tune code", the corresponding header contains some information too.

 

Maybe one day I'll try to write a minimal example, that doesn't use Start. Not really in the mood for that right now. But I was curious enough to peek into the library disassembly, it seems the PTC is an alternate function of ADC0 on the tinyAVR-1 chips (the registers are in the same address range, though some are different).