2018-07-02 03:49 AM
Posted on July 02, 2018 at 12:49
Hi Friends !
As discussed in my earlier post we have developed 44 Keys capacitive touch key pad with 4 layer PCB board in Matrix touch scheme between two touch TSC groups with Layer 1= top Digital track, Layer 2= shield and touch track, Layer 3= shield and Layer 4 = touch and digital track, based on STM32L452VET6 100 Pin LQFP package using TSC Peripheral and STM touch middle ware.
Although we are using these Touch IPs very frequently and successfully in Non Matrix touch scheme but this is first we have used it in this format to meet the customer requirement for 44 Nos of keys. I have attached Picture of top and bottom of the PCB for your kind reference.
We are facing calibration issues as keys are non sensitive when applied overlay of 1mm of acrylic. We have applied capacitors of upto 68nf but there is no change in the delta and no touch detected.
But without overlay there is the touch detection but poor calibration and response below is the screen shot for the same.
When in Ideal State
When a key is pressed without overlay
Kindly advice how to calibrate it by increasing touch sensitivity.
Thanks and Best Regards,
VK Verma
st.mcu
‌
Majerle.Tilen.001
2018-07-04 09:00 AM
Hi
Verma.V.K
,First, I would like to know if you have already reviewed the application note
: Guidelines to increase the number of touch sensing touchkeys?When using matrix, please note that:
It is recommended to have homogenous sized touchkeys so that each touchkey has the same sensitivity.
This simplifies the threshold setup and acquisition can be achieved using the same sampling capacitor value.In all cases, you have to pay attention to &39ghost effect&39 as described in the application note.
Then, in order to increase touch sensitivity, please take into consideration the following:
I hope this bring you some help.
-Amel
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.
2018-07-05 12:54 AM
I have not made a touch board before, but Ive been working on one last week.
there should be no surface mount parts on the touch side, to reduce air spaces
I think this is your answer:
Reduce air-gap� between pcb and overlay thanks
st.mcu
can you pour some thin goop between the PCB and the 1mm of acrylic ?. and be sure to remove all air bubbles
this will remove all airspaces and increase the sensing range.
It may actually work better with a thicker acrylic/goop.
2018-08-04 11:03 AM
@Amel NASRI @VK Verma Hi can you please help me with my TSC on nucleo stm32l432kc. I'm still trying to implement a simple touch key. I'm using this code: [https://github.com/Rayling35/STM32Cube_FW_L4_V1.12.0/blob/master/Projects/STM32L476G-EVAL/Examples/TSC/TSC_BasicAcquisition_Interrupt/Src/main.c] but it stops at step #-6- "Check if the acquisition is correct (no max count) "
if (HAL_TSC_GroupGetStatus(&TscHandle, TSC_GROUP1_IDX) == TSC_GROUP_COMPLETED)
The above If condition is never true and thus the acquisition is never completed. Any idea what could be wrong?
2018-08-04 02:05 PM
Hi,
I use this to initialise my set:
void initTSC(void){
htsc.Init.ChannelIOs = TSC_GROUP1_IO3 | TSC_GROUP2_IO3 | TSC_GROUP3_IO3 | TSC_GROUP5_IO3 | TSC_GROUP6_IO3 | TSC_GROUP7_IO3 | TSC_GROUP8_IO3;
htsc.Init.SamplingIOs = TSC_GROUP1_IO4 | TSC_GROUP2_IO4 | TSC_GROUP3_IO4 | TSC_GROUP4_IO2
| TSC_GROUP5_IO4 | TSC_GROUP6_IO4 | TSC_GROUP7_IO4 | TSC_GROUP8_IO4;
htsc.Init.ShieldIOs = TSC_GROUP4_IO1;
/* Disable Schmitt trigger hysteresis on all used TSC IOs */
htsc.Instance->IOHCR = 0; // (uint32_t)(~(htsc.Init.ChannelIOs | htsc.Init.ShieldIOs | htsc.Init.SamplingIOs));
/* Set channel and shield IOs */
htsc.Instance->IOCCR = (htsc.Init.ChannelIOs | htsc.Init.ShieldIOs);
/* Set sampling IOs */
htsc.Instance->IOSCR = htsc.Init.SamplingIOs;
/* Set the groups to be acquired */
htsc.Instance->IOGCSR = TSC_extract_groups(htsc.Init.ChannelIOs);
/* Clear interrupts */
// htsc.Instance->IER &= (uint32_t)(~(TSC_IT_EOA | TSC_IT_MCE));
/* Clear flags */
htsc.Instance->ICR = (TSC_FLAG_EOA | TSC_FLAG_MCE);
//HAL_StatusTypeDef TSCIntError = HAL_TSC_Start_IT(&htsc); //HAL_TSC_Start(&htsc);
reStartTSC = true;
}
I have a worker thread running every mSecond:
if(mSint) {
mSint = false;
static char startTSC = false;
if (reStartTSC)
{
reStartTSC++;
if (reStartTSC > 25) //repeats every 25mS
{
reStartTSC = false;
HAL_StatusTypeDef x = HAL_TSC_Start_IT(&htsc); // process min/max within interrupt.
}
}
and this is the interrupt process
void HAL_TSC_ConvCpltCallback(TSC_HandleTypeDef* htsc) {
TSCCvtFlag = true;
/* Clear interrupt flags */
htsc->Instance->ICR = (TSC_FLAG_EOA | TSC_FLAG_MCE);
{
//save Counters.
uint32_t * registerPtr = htsc->Instance->IOGXCR; //__IO uint32_t IOGXCR[8]; // TSC
for (int i = 0; i < 8; i++)
TouchTable[i] = (int16_t)(* registerPtr++);
2018-08-05 09:01 AM
@Community member Thanks for the code. Which board are you using? And for the code, can you tell me how did you define mSint and reStartTSC and TouchTable. I would like to see the complete code with the main method please.
2018-08-05 01:34 PM
int16_t TouchTable[3][8]; // 3 groups of 8 sensors
uint8_t reStartTSC;
char mSint; //mS flag
uint16_t mS; // mSecond counter
// initialisation ///////////
void HAL_SYSTICK_Callback(void) {
// SysTick_Handler_Flag = true;
mS++; // my 1000mS counter
mSint = true;
if (mS == 1000) {
secondInt = true;
mS = 0;
}
}
hope it helps,