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
Solved! Go to Solution.
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
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
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.
Commenting out
EventCounter++; //increment EventCounter
in the callback function solves the problem.
Still more puzzled.
Changing the TSI Channel property does not have any effect. TSI0_CH9 and TSI0_CH10 are always used.
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
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.
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
Hello,
this link might also help:
Tutorial: Touching the Freedom KL25Z Board | MCU on Eclipse
best regards
Vojtech Filip
Processor Expert Support Team