9 years, 7 months ago.

Using individual electrodes as touch sensors with Freescale TSI library

Hello,

I would like to use my FRDM-KL25 TSI resources to create a 4-key keyboard, using 4 TSI channels. I tried looking at the TSI library, but it seems dedicated to the on-board analog slider. Is it possible to use functions inside the library to calibrate the baseline and measure the sensor values to create my keyboard, or I should create a new library from scratch?

I tried to fumble with the original library, but I can only find functions for setting values for baseline and electrode value, and for reading them, but it only reads the values that were previously set.

Cheers

Antonio

See my answer

posted by Martin Kojtal 19 Sep 2014

I also looked at it once, and ideally there would be a common TSI object, which could both be reused for a button, slider, and possible other configurations. But currently it indeed isn't possible to do this using the mbed slider lib.

That lib could be the base of designing it yourself though.

posted by Erik - 19 Sep 2014

I believe that the best thing to do is to create a new TSI lib from scratch. I intend to start creating the basic "low-level" functions, like creating a baseline, calculating deltas, etc., for individual electrodes. Then me or others can build packages, like sliders, rotaries, or numeric keypads, on top of these functions.

Hopefully I will have the basic low-level library created soon. If anyone wants to join me, just drop me a message.

Cheers,

Antonio

posted by Antonio Quevedo 19 Sep 2014

I have created a VERY low-level TSI library to start building on top of it. It can be found at:

http://mbed.org/users/quevedo/code/TSIHW/

Cheers

posted by Antonio Quevedo 24 Sep 2014

1 Answer

9 years, 7 months ago.

Hi, whiuch tsi library are you refering to?

There's also TSS library from Freescale which contains C++ wrapper in the latest version but license does not allow to publish it on mbed. That would give you what you need, if you keep it private. I can help you out as I implemented it :)

Does this do what you need, it's just using TSI original mbed lib, http://mbed.org/users/virajjayaweera/code/TouchButton/

Regards,
0xc0170

Accepted Answer

Hi Martin,

Thanks for your prompt response. Going from end to beginning... the TouchButton library is an interesting idea, but it does not work for my application. I have designed a shield with 4 individual PCB areas as keys, and I have already made it work using Eclipse and the TSS library, but I want to use it in mbed code.

I would really appreciate if you could help me out to implement the TSS library in my private mbed project.

Thanks in advance.

Antonio

posted by Antonio Quevedo 19 Sep 2014

Look at LIB folder where is cpp_wrapper, which is what you can use on mbed.

This is how main looks like for analog slider, using that wrapper:

int main(void)
{
  NVIC_SetVector(TSI0_IRQn, (uint32_t)TSS_TSI0Isr);
  slider = static_cast<TSSASlider*>(TSSControlFactory::createTSSControl(0));  /* factory creates control number 0 */
  tss_system = TSSSystem::getTSSSystem(); /* get system pointer for callback registration */
 
  myled = 1;
  tss_system->regCallback(&myFaultCallback);
  slider->enable(TSS_ALL_RELEASE);
  slider->regCallback(&myCallbackMovement, TSSASlider::ASLIDER_MOVEMENT);
  slider->regCallback(&myCallbackAllRelease, TSSASlider::ASLIDER_ALL_RELEASE);
 
  for(;;)
  {
    if (TSSSystem::TSSTask() == TSS_STATUS_OK)
    {
    }
  }
 
}
posted by Martin Kojtal 20 Sep 2014