cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L053-DISCO Touch button issue

purkovic
Associate II
Posted on August 18, 2015 at 10:36

The original post was too long to process during our migration. Please click on the attachment to read the original post.
7 REPLIES 7
purkovic
Associate II
Posted on August 18, 2015 at 11:07

Solved by myself. 

Ensure that Touch keys are marked as extended in tsl_conf.h and not basic!
Thierry GUILHOT
ST Employee
Posted on August 19, 2015 at 15:32

Hello,

There are two solutions to your problem:

•1st one: you modify the main.c file of the TouchSensing_Linear application example to simulate several touchkeys by defining some linear position ranges.

•2nd one: you modify the following files tsl_conf.h, tsl_user.h, tsl_user.c and main.c to use the linear sensor as touchkeys. This solution is fine but you will certainly get some side effects (touch crosstalk and reduce sensitivity on the channel 0) due to the fact that the sensor layout is not appropriate.

For the second solution, please find attached a working example. We will investigate if a such example can be added into the STM32Cube package.

There is currently no user manual specifically covering the TouchSensing library included into STM32Cube packages. There is onlythe UM1606 which is covering the STMTouchlibrary which is very closed to the one available into STM32CUbe packages.A new UM covering the TouchSensing Library is on-going and should be available within September.

Best Regards,

Thierry,

________________

Attachments :

TouchSensing_3Tkeys.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0gd&d=%2Fa%2F0X0000000bcS%2FVVZFWIaHCE8AJQoo5bRnU1gYP71ff8WoqYmjv3y7aHQ&asPdf=false
purkovic
Associate II
Posted on August 26, 2015 at 09:54

Hello Thierry, 

Thanks for the answer. 

I currently have 8ch and 8 banks Touchkeys. 

I would like to have cascade acquisition of all touchkeys (banks).

 I've done the following:

#define  TSLPRM_USE_ZONE (1) in tsl_conf.h

TSL_tIndex_T MyBankSorting[TSLPRM_TOTAL_BANKS] = {0, 1, 2, 3, 4, 5, 6, 7};

TSL_Zone_T MyZone = {

  MyBankSorting,

  0,

  8 // Number of Banks in the Zone

};

 

In tsl_user.c 

 

It seems as zone (cascade) is not working.

Do I need to add this somewhere?

 TSL_acq_ZoneConfig(&MyZone, 0);

tyr0
Associate II
Posted on September 08, 2015 at 19:29

Hi

I just did the everything in the same way (replaced the linear sensor with the touch buttons)

But I always get the 2 closed buttons pressed, even I press only one. 

Amel NASRI
ST Employee
Posted on September 09, 2015 at 15:58

Hi a.alya,

What about the example provided by Thierry? Did you tested it?

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

tyr0
Associate II
Posted on September 30, 2015 at 11:36

Hi Mayla

I tested all the samples and it seems I found a solution

On my side one bunk per channel works, If I assign a few channel to one bank it does not work.

Also

The are 20 state of touch sensor detection : TSL_StateId_enum_T

Why only 2 works?

I mean to detect a key pressing (in fact touching)

I use TSL_STATEID_DETECT and  TSL_STATEID_DEB_RELEASE_DETECT

like

#define TKEY_PRESSED(NB)\

    ((MyTKeys[(NB)].p_Data->StateId == TSL_STATEID_DETECT) || \

     (MyTKeys[(NB)].p_Data->StateId == TSL_STATEID_DEB_RELEASE_DETECT))

But all other states does not work. Why is that?

I never get TSL_STATEID_TOUCH, for example as well as other states.

So to detect a first touching, long touching I need to use my own additional triggers, flags etc.

Posted on April 04, 2017 at 22:40

This does a pretty good job of explaining things:

http://www.st.com/content/ccc/resource/technical/document/user_manual/group0/d6/4c/20/0d/a1/c1/4c/99/DM00210526/files/DM00210526.pdf/jcr:content/translations/en.DM00210526.pdf

Several states like 'TOUCH' require DXS (Detection Exclusion System) to be enabled in the

tsl_conf.h

file.

Others like PROXIMITY require that to be enabled as well.

The state you are using TSL_STATEID_DEB_RELEASE_DETECT isn't a real good one to use. That state is when it is in debouncing, meaning 'I MIGHT' have a release happening. If the number of release detections passes the DEBOUNCE setting, then that state will transition to a solid RELEASE state.