2015-06-12 05:58 AM
Hi guys,
I got problems including some TouchPads with the ''transfer acquisition principle'' with a STM32L052R6 and the CubeMX-generated HAL_TSC library. I couldn't find an example code or a evaluation board, from which I can get the sequence read out a touch-channel and see if it detected a finger or not. Would be great if anybody who knows like it works would help me a bit. Thanks an have a nice weekend Edit: Tried something like this yet:tscioconfig.ChannelIOs |= TSC_GROUP6_IO1 | TSC_GROUP8_IO4 ;
tscioconfig.SamplingIOs |= TSC_GROUP6_IO4 | TSC_GROUP8_IO3; tscioconfig.ShieldIOs |= TSC_GROUP1_IO2; HAL_TSC_IOConfig(&htsc, &tscioconfig); // Discharge HAL_TSC_IODischarge(&htsc, DISABLE); HAL_Delay(1); HAL_TSC_Start(&htsc); HAL_TSC_PollForAcquisition(&htsc); // HAL_TSC_GetState(); ui32_calc1 = HAL_TSC_GroupGetStatus(&htsc, TSC_GROUP6); ui32_calc1 = HAL_TSC_GroupGetStatus(&htsc, TSC_GROUP8); ui32_calc2 = HAL_TSC_GroupGetValue(&htsc, TSC_GROUP6); ui32_calc2 = HAL_TSC_GroupGetValue(&htsc, TSC_GROUP8); HAL_TSC_Stop(&htsc); #stm32l0-touch-hal-tsc-cubemx2015-06-15 02:17 AM
Hello Olivjer,
1-you need at first to configure the TSC peripheral 2- Configure the touch-sensing IOs: IoConfig.ChannelIOs = TSC_GROUP6_IO2; IoConfig.SamplingIOs = (TSC_GROUP6_IO3 | TSC_GROUP3_IO3 | TSC_GROUP1_IO3 | TSC_GROUP8_IO2); IoConfig.ShieldIOs = TSC_GROUP8_IO1;3- Discharge the touch-sensing IOs HAL_TSC_IODischarge(&TscHandle, ENABLE); HAL_Delay(1); 4- Start the acquisition process if (HAL_TSC_Start(&TscHandle) != HAL_OK) { Error_Handler(); }5- Wait for the end of acquisition while (HAL_TSC_GetState(&TscHandle) == HAL_TSC_STATE_BUSY) { }6- Clear flags __HAL_TSC_CLEAR_FLAG(&TscHandle, (TSC_FLAG_EOA | TSC_FLAG_MCE));7- Check if the acquisition is correct: if (HAL_TSC_GroupGetStatus(&TscHandle, TSC_GROUP6_IDX) == TSC_GROUP_COMPLETED) {8- Store the acquisition value uhTSCAcquisitionValue = HAL_TSC_GroupGetValue(&TscHandle, TSC_GROUP6_IDX);}I hope that helpSyrine2015-06-15 07:09 AM
Good afternoon syrine,
Thanks a lot for your help, that helped me enormous understanding the whole handling of the HAL_TSC lib. I've implemented the process into my code but I always get a 1 back after the command ''HAL_TSC_GroupGetValue(&TscHandle, TSC_GROUP6_IDX);'' so I maybe made a mistake with the hardware. May I ask you, what value your ESD-Resistors (serial in the path from TouchPad to Microprocessor-Input) and what value your Sampling-Capacitors (Shield and Groups) are? ESD-Resistors: 2.7 kOhm Group-Sampling: 100 pF Shield-Sampling: 100 pF Maybe I should go higher with the values of the capacitors to charge them better? Thank you again for your help, appreciate it very much! Olivjer2015-06-16 10:43 PM
Hi,
you can look at stm32l discovery board, there are used capacitors 47nF a resistors 10k. Now I´m developing control touch panel with stm32l053. I tried more values of capacitors and it always works (only change of touch response)2015-06-22 08:00 AM
You were right, I've found the values in the Eval-Board. Thanks for that!
You said you tried a lot of combinations. With what combinations you had the best results in distance between finger and touchpad? In my case it works only, if the finger really touchs the Touchfield, but in my opinion it should also work with a little gap of 1-2mm, or not?2015-06-22 10:55 PM
Look at the application notes ''Guidelines for designing touch sensing applications'' (http://www.st.com/web/en/resource/technical/document/application_note/CD00222015.pdf) there is described how to design touch sensing app. I think to high sensitivity sensor is important size of electrode surface: larger electrode -> higher capacity -> higher sensitivity
2015-06-23 01:39 AM
Thanks a lot. I already did this, it does not decribe what to do when you have a low sensivity. Tried also a lot of diferent values for the capacitors.
As I understand the Touchfield should only be as large as the thing you touch it with, otherwise the parasitic capacitance increases.2017-09-22 12:29 AM
what is the shield samping used for ? is it nessary?
2017-09-25 04:33 AM
does the sensor work with you without shielding?
2017-09-26 09:16 PM
I got a project generated by CubeMX, without shieldIO setting, and I haven't make it run. Is there a exampling project for STM32F051?