QTouch--where are the sample programs?

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

Full disclosure: I'm dipping my toe into deep waters, with swirling currents of Studio6, ASF, QTouch, and related GCC (or is that "Atmel Toolchain"?). As they are all inter-related in this case and there is no QTouch forum, I picked the general forum to start. Snipe away...

-- The QTouch spreadsheet Library_Selection_Guide.xls has a line for mega88PA (out of the 1600 possibilities). One field is the applicable sample program (at least as I read it): \Generic_QTouch_Libraries\AVR_Tiny_Mega_XMega\QTouch\example_projects\avr4g1_qt_example\avr4g1_qt_example.aps

I find that, nor any applicable .aps, on my hard drive. So where are these sample programs?

-- Given no "applicable .aps", I'd think there would be a bunch of example programs loaded somewhere...

-- Backing up:
=> New Windows7 PC
=> Fresh install of Studio6, with the versions etc. in the largish Help/About "dump" below
=> ASF updated to 3.13
=> QTouch library 5.2
=> Associated QTouch Composer

-- Since I couldn't find the sample program(s), from the Start Page I did a New Project/GCC C QTouch Executable Project and went through the "wizard" and make a QTouch project for ATmega88PA. All went through, and I can build/rebuild successfully. Yay! So, you say, what is the problem? Well, a few questions, anyway...

-- 2) Can one go back through that "wizard" again to reconfigure the created project? Or do you have to start all over again to change something?

-- 3) The resulting app is definitely configured to a certain AVR speed. I cannot find where to set my processor speed. No F_CPU or similar anywhere... ???

-- 4) I need only one touch button in an otherwise Mega48-class app. The resulting nearly 4k program seems like overkill, with all the apparent ASF layers and so forth. For a single button, would I be better off to regress to pre-ASF setup?

TIA

Lee

=========================
Help/About dump of installed items
=========================

Atmel Studio 6 (Version: 6.1.2730 - Service Pack 2)
© 2013 Atmel Corp.
All rights reserved.

OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
Platform: Win32NT

Installed Packages: Shell VSIX manifest - 6.1
Shell VSIX manifest
Version: 6.1
Package GUID: 5aa6ea3e-da7b-48c1-9b2a-cab2329d32ac
Company: Atmel Corporation

Installed Packages: Atmel ARM GNU Toolchain - 4.7.3.1029
ARM Toolchain
Version: ARM_Toolchain_Version:4.7.3.158 GCC_VERSION:4.7.3
Package GUID: D83C9208-1D2D-4665-9760-EB9EE264CF8F
Company: Atmel
HelpUrl:
Release Description: ARM Toolchain

CMSIS
Version: 3.20
Package GUID: D83C9208-1D2D-4665-9760-EB9EE264CF8F
Company: Atmel
HelpUrl:
Release Description: ARM Support File Version

Installed Packages: AVR macro Assembler - 2.1.39.1005
AVR Assembler
Version: 2.1.39.232
Package GUID: 03CB4AE1-80EA-40C7-B561-98CC87EA539C
Company: Atmel
HelpUrl:
Release Description: AVR Assembler For 8-Bit Devices

Installed Packages: Atmel AVR (32 bit) GNU Toolchain - 3.4.2.1002
AVR Toolchain 32
Version: AVR32_Toolchain_Version:3.4.2.435 GCC_VERSION:4.4.7
Package GUID: DB6D383F-C5D9-4E7E-BBF9-F37C6EEB59FD
Company: Atmel
HelpUrl:
Release Description: AVR Toolchain For 32-Bit Devices

Installed Packages: Atmel AVR (8 bit) GNU Toolchain - 3.4.2.1002
AVR Toolchain 8 Bit
Version: AVR8_Toolchain_Version:3.4.2.992 GCC_VERSION:4.7.2
Package GUID: 2C7AA7CF-94C6-463C-81DA-4AA03B613C3B
Company: Atmel
HelpUrl:
Release Description: AVR Toolchain For 8-Bit Devices

Installed Packages: Atmel Gallery - 1.3.1
Atmel Gallery
Version: 1.3.1
Package GUID: AtmelStudioExtensionManager
Company: Atmel

Installed Packages: Atmel Kits - 1.2.147
Atmel Kits
Version: 1.2.147
Package GUID: bea809ab-462e-4535-99f1-3f9ced2f09ff
Company: Atmel

Installed Packages: Atmel Software Framework - 3.13.1.822
ASF
Version: 3.13.1
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.13.1
Release Description: ASF - 3.13.1 Release

ASF
Version: 3.12.1
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.12.1
Release Description: ASF - 3.12.1 Release

ASF
Version: 3.11.0
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.11.0
Release Description: ASF - 3.11.0 Release

ASF
Version: 3.10.1
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.10.1
Release Description: ASF - 3.10.1 Release

ASF
Version: 3.9.1
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.9.1
Release Description: ASF - 3.9.1 Release

ASF
Version: 3.8.1
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.8.1
Release Description: ASF - 3.8.1 Release

ASF
Version: 3.7.3
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.7.3
Release Description: ASF - 3.7.3 Release

ASF
Version: 3.6.0
Package GUID: 8BA748A3-6DE3-4707-BBE4-FBB45AC9A491
Company: Atmel
HelpUrl: http://asf.atmel.com/3.6.0
Release Description: ASF - 3.6.0 Release

Installed Packages: AtmelToolchainProvider - 6.1.0.461
AtmelToolchainProvider
Version: 6.1.0.461
Package GUID: AtmelToolchainProvider.Atmel.83804b14-6626-4e13-bfdc-3a0135fa98f1
Company: Atmel

Installed Packages: ATSAMD20_PTC - 6.1.0
ATSAMD20_PTC
Version: 6.1
Package GUID: 4d0d8e71-5466-4cc4-86e8-5772281a3d5b
Company: Atmel
HelpUrl:
Release Description: Device Support Pack, By installing this device pack you will extend AtmelStudio 6.1 with support for the following devices ATSAMD20E14 ATSAMD20E15 ATSAMD20E16 ATSAMD20E17 ATSAMD20G14 ATSAMD20G15 ATSAMD20G16 ATSAMD20G17 ATSAMD20G18 ATSAMD20J14 ATSAMD20J15 ATSAMD20J16 ATSAMD20J17 ATSAMD20J18

Installed Packages: QTouch Composer 5.2 - Beta - 5.2.0.2036
QTouch Composer 5.2 - Beta
Version: 5.2.0.2036
Package GUID: CADCC017-04B3-4F76-A417-E0864EFE8B6C
Company: Atmel

Installed Packages: QTouch Library 5.2 - 5.2.0.2090
QTouch Library 5.2
Version: 5.2.0.2090
Package GUID: ACB67F90-B3F4-46FD-9D1C-50D0E9026CC8
Company: Atmel

Installed Packages: Visual Assist X for Atmel Studio - 10.7.1930.2
Visual Assist X for Atmel Studio
Version: 10.7.1930.2
Package GUID: 7997A33C-B154-4b75-B2AC658CD58C9510
Company: Whole Tomato Software

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Quote:
Snipe away..
Doens't the song say "suicide is painless"?

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Quote:

Quote:
Snipe away..
Doens't the song say "suicide is painless"?

Hey, King John--I did all the downloads and updates and the poking around to this point in half a day. I seem to recall...
js wrote:
Quote:
installing AS6 is SO much easier!
And so quick too, it may only take a few days..... :evil:

https://www.avrfreaks.net/index.p...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

... thoughts of wet fish and royal face...

Ross McKenzie ValuSoft Melbourne Australia

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

I believe it is possible to remove a service/driver or whatever from a "solution" or "project", using the ASF wizard. I am able to say this as I have been dipping my toe into the ASF water, mainly as a consequence of working with the SAM4. I never saw the need for ASF when using Meagre and XMeagre chips, but the increased complexity of the SAM4 pushed me over the edge. For someone who likes to have one big, long C source file containing almost everything, it's a bit of a departure, and it can take me days to find the relevant source file out of the millions attached to the "solution/project", but I am nonetheless fairly impressed so far.
Re. the CPU speed, I can't help you. I just spent 5 minutes trying to find out where it's defined in my SAM4 project, but without success.

Four legs good, two legs bad, three legs stable.

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

Quote:
in half a day.
So does t all work for you?

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Lee,

is it perhaps in the Qtouch library:

http://www.atmel.com/tools/QTOUCHLIBRARY.aspx

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

Oh dear, it looks like Atmel hasn't paid the rent for the QTOUCH forum, the account is suspended.
http://forum.atmel.com/cgi-sys/s...

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Quote:

So does t all work for you?

Well, as far as I have gone it "works". Studio6 is installed and apparently functional; it is linked properly to the installed GCC toolchain; the QTouch stuff installed OK; the QTouch "wizard" seemed OK--the resulting project built cleanly.

Apparently few/no QTouch library users visiting here to address my questions.

Does the touch button work? I'm a few steps from that; I'd have to properly configure everything first and rebuild, and construct a button.

(Actually, we have several Atmel touch keypads already but used separate chips. This app is cost-sensitive and needs only one button so I am investigating whether I can use the main controller AVR to do it vs. an extra $0.60 chip.)
Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Quote:

-- 2) Can one go back through that "wizard" again to reconfigure the created project? Or do you have to start all over again to change something?

Yes!

To learn how, one must RTFM. ;) The wizard that I encountered is the Project Builder of QTouch Composer...

Quote:
Modifying QTouch project parameters after creating QTouch project

QTouch Project Builder can be invoked by any one of the following methods after project creation:

Double click or press Ctrl+Q on the .qtdgn file in the project.

Right click on the project node or .qtdgn file to open the project context menu. Select QTouch project builder in the context menu.

Select .qtdgn file in the solution explorer. Select QTouch Project Builder from View menu.
...

Now back to the AVR clock rate...that Project Builder has the device selection (AVR model) and some parameters but the Speed is shown as zero. Continuing to dig... [this thread is starting to sound like a blog]

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Well, after further work I am back to the thread title question: Where are the sample programs?

We are about ready to try out a simple test program using the wizard-generator program as the base. "touch_measure" is called--but I can't figure out where the results are... Seeing a sample program would really help. :(

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

The proper forum for the questions would have been the Qtouch forum but for some reason that's dead now. :roll:

And for what it's worth I never managed to get the Qtouch example programs in AS4 working either.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I have created a working test setup with the QT600 eval board. Was about to embark on disconnecting the special baords and make a demo myself, but then the project got shelved. Even worst as I in the mean time have gotten a new PC at work I have lost access to my old PC's stuff. and as I am a hardware guy, I was still working on getting that stuff to work so nothing on the network drive.
I do remember though that using the composer in AS6 ( also the separate program for that matter) there effectively was no way back, just forward(you could press the back button, but bad things would happen then) I could only get things to work with the QT600 board when I wend through it from start to finish and did not do any steps back.

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

Thanks, meslomp.

Success, since my last "blog" posting!

I still haven't figured out where the sample programs are, nor have I found where the below is explicitly laid out in the documentation. But anyway, I found an "example" in the debug-dump routines and grabbed that byte. We grabbed an existing Mega48 board (not Mega48PA as specified in the "wizard", wired a pair of AVR port pins with cap and resistor and a wire to one of our existing touch keypad boards. And it works! Tuning needed, and (in this case) perhaps considerations with the wire length.

Quote:

I do remember though that using the composer in AS6 ( also the separate program for that matter) there effectively was no way back, just forward(you could press the back button, but bad things would happen then)

With the Composer 5.2 and new 6.1 Studio and new ASF, the wizard seems pretty nice. I can go through it repeatedly and it just updates the generated code. It does not fuss with my additions to main.c .

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Hi all,

I'm a newbie on AVR, micro-controllers and programming but I think, if I did understand, that I have some answers.

Quote:
I find that, nor any applicable .aps, on my hard drive. So where are these sample programs?

for That you have to make File/new/example project and search for Qtouch.

Quote:
-- 2) Can one go back through that "wizard" again to reconfigure the
created project? Or do you have to start all over again to change something?

A double click on the .qtdgn directory in the Solution explorer and it will reopen the wizard or my preferred way is to open the touch.c and touch.h files in the same directory and tweak them at your need.

Quote:
-- 3) The resulting app is definitely configured to a certain AVR speed. I cannot find where to set my processor speed. No F_CPU or similar anywhere... ???

In the touch.h file you'll find this line :

/**
  * Provide the number of timer clock ticks (cycles) required to provide a 1 millisecond time interval.
  * TICKS_PER_MS = (CLK_FREQ/TIMER_PRESCALER)*(1/1000)
  * Example, TICKS_PER_MS = (8MHz/64)*(1/1000) = 125
  */
#define TICKS_PER_MS 15u

Hope it helps, sorry for my english.

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

No wonder I'm confused:

Quote:

...
/*============================================================================
Name : qt_set_parameters
------------------------------------------------------------------------------
Purpose : This will fill the default threshold values in the configuration
data structure.But User can change the values of these parameters .
Input : n/a
Output : n/a
Notes : Generated Code from QTouch Studio. Do not change
============================================================================*/

static void qt_set_parameters( void )
{

/* This will be modified by the user to different values */
qt_config_data.qt_di = 4;
qt_config_data.qt_neg_drift_rate = 20;
qt_config_data.qt_pos_drift_rate = 5;
qt_config_data.qt_max_on_duration = 0;
qt_config_data.qt_drift_hold_time = 20;
qt_config_data.qt_recal_threshold = 1;
qt_config_data.qt_pos_recal_delay = 10;

}


Are any of you 'Freaks QTouch library users? I've got it going, but am having trouble tuning.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

What kind of "trouble tuning"?

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

Quote:

What kind of "trouble tuning"?


It works--but it is so much of a black box. And (unlike e.g. fatfs) the configuration parameters are scattered hither and yon.

1) I still haven't figured out where you tell the library what speed you are running at. (and it is NOT "TICKS_PER_MS") But there are definitely different results when the AVR is running at 8MHz vs. 1MHz.

2) How long should it take to do a touch_measure()? The docs say ~2ms with 1kohm and 22nf. I see more like 5ms at 8MHz and 20ms at 1MHz.

3) I got a little farther since posting yesterday, experimenting with qt_set_parameters() items and so forth. My setup was a bit too sensitive. Changing detect threshold in qt_enable_key call changes the sensitivity. (Wizard gave 10, on the low end of the "usual" of the docs. 100 (255 max) rendered the button unusable. 20 (at the high end of the "usual") indeed changed to less sensitive; we settled on 30.)

So, yeah, it pretty much works. I can't say I'm really happy, though, for all the reasons in this "blog".

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

theusch wrote:
So, yeah, it pretty much works. I can't say I'm really happy, though, for all the reasons in this "blog".
That pretty much summarizes my experience with touch, both software library and the QT chips.

For sensitivity, more often than not I leave detect threshold alone (well, maybe bump it up compared to the default values) and instead play with burst lengths.

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

Have you figured out a way to get 'raw' readings?

 

  https://www.avrfreaks.net/forum/q...

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

No, never bothered.  Basically, I use the "wizard", and then do a bit of tuning with a few parameters. 

As mentioned, the only "tuning" on my last couple apps is in qt_enable_key() as mentioned above.  In the fragment below, you can see with my comments that I only changed one parameter--and with a revised board layout, I was back to the default. ;)

 

static void config_sensors(void)
{
//	qt_enable_key( CHANNEL_0, NO_AKS_GROUP, 10u, HYST_6_25 ); too sensitive
//	qt_enable_key( CHANNEL_0, NO_AKS_GROUP, 20u, HYST_6_25 ); // about right?
//	qt_enable_key( CHANNEL_0, NO_AKS_GROUP, 30u, HYST_6_25 ); // try even less; works with firm gloved finger press
	qt_enable_key( CHANNEL_0, NO_AKS_GROUP, 10u, HYST_6_25 ); // new board layout trial

}

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.