TSS Keypad not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TSS Keypad not working

Jump to solution
1,385 Views
Alberto_g
Contributor III

I adapted the Tower board keypad example to a Freedom board.

At first it is OK, but after exactly 10 touches the callback function is not called anymore.

Am I doing something wrong?

 

Regards

Original Attachment has been moved to: TSS.zip

0 Kudos
1 Solution
1,005 Views
moravcik
Contributor III

Hi Alberto,

I checked your code and in the main() function is placed following strange while loop:

  while (EventCounter < MAX_EVENTS) {

    TSS_Task();

  }


It means that if the counter EventCounter reaches MAX_EVENTS then TSS_Task() is not called anymore and TSS stops to work. That is the reason why callback is not generated anymore. TSS_Task() should be called permanently.

Best Regards

Peter Moravcik

TSS SW team

View solution in original post

0 Kudos
8 Replies
1,006 Views
moravcik
Contributor III

Hi Alberto,

I checked your code and in the main() function is placed following strange while loop:

  while (EventCounter < MAX_EVENTS) {

    TSS_Task();

  }


It means that if the counter EventCounter reaches MAX_EVENTS then TSS_Task() is not called anymore and TSS stops to work. That is the reason why callback is not generated anymore. TSS_Task() should be called permanently.

Best Regards

Peter Moravcik

TSS SW team

0 Kudos
1,005 Views
Alberto_g
Contributor III

You are right!

The strange loop comes straight from the Tower KL25 TSS example, in C:\Freescale\CW MCU v10.3\MCU\CodeWarrior_Examples\Processor_Expert\Kinetis\TWR-KL25Z48M\TSS\Sources.

This nasty death countdown can be confusing, IMHO.

One less thing to worry about, thanks a lot.

0 Kudos
1,005 Views
Alberto_g
Contributor III

Commenting out

EventCounter++; //increment EventCounter

in the callback function solves the problem.

Still more puzzled.

0 Kudos
1,005 Views
Alberto_g
Contributor III

Changing the TSI Channel property does not have any effect. TSI0_CH9 and TSI0_CH10 are always used.

0 Kudos
1,005 Views
moravcik
Contributor III

Hi Alberto,

Please, check what is really written in the TSS_SystemSetup.h file. TSI electrode assignment is defined by macro TSS_Ex_TYPE. Be aware you have to do 'Generate Processor Expert Code' if you change anything in the TSS component configuration and then TSS_SystemSetup.h file is completely regenerated.

Best Regards

Peter Moravcik

TSS SW team


1,005 Views
Alberto_g
Contributor III

In fact I was able to select another electrode, later on. I am quite sure about having performed  the Generete Code part.

I will report any further problem.

Thanks again.

0 Kudos
1,005 Views
c0170
Senior Contributor III

Hello,

the example for the freedom boards KL25 and KL05 are part of the TSS release (3.0 and 3.0.1 as far as I remember). You can check them out. If you have any doubts, please read User guide which provides useful information :smileywink:

I don't see any problem with counter in the callback. Even though it might overflow, that does not explain why callback is not generated after 10 touches.

Regards,

MartinK

0 Kudos
1,005 Views
vfilip
NXP Employee
NXP Employee

Hello,

this link might also help:

Tutorial: Touching the Freedom KL25Z Board | MCU on Eclipse

best regards

Vojtech Filip

Processor Expert Support Team


0 Kudos