cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L475 Touch Sense not changing status from BUSY

NFerr.1
Associate II

Hello! I'm trying to use a custom PCB STM32L475 with the touch sensing library based on the 1 touch example there is available for the L4xx.

I've configured the PC8 pin as TSC_G4_IO3 (as sampling pin) and both PC6 and PC7 as TSC_G4_IO1 and TSC_G4_IO2 (as inputs) with no pin as shielding input.

In the main code, I've initialized TSC and Touchsensing with MX_TSC_Init();

 MX_TOUCHSENSING_Init();

The MX_TSC_INIT is declared as following:

 htsc.Instance = TSC;

 htsc.Init.CTPulseHighLength = TSC_CTPH_2CYCLES;

 htsc.Init.CTPulseLowLength = TSC_CTPL_2CYCLES;

 htsc.Init.SpreadSpectrum = DISABLE;

 htsc.Init.SpreadSpectrumDeviation = 1;

 htsc.Init.SpreadSpectrumPrescaler = TSC_SS_PRESC_DIV1;

 htsc.Init.PulseGeneratorPrescaler = TSC_PG_PRESC_DIV32;

 htsc.Init.MaxCountValue = TSC_MCV_8191;

 htsc.Init.IODefaultMode = TSC_IODEF_OUT_PP_LOW;

 htsc.Init.SynchroPinPolarity = TSC_SYNC_POLARITY_FALLING;

 htsc.Init.AcquisitionMode = TSC_ACQ_MODE_NORMAL;

 htsc.Init.MaxCountInterrupt = DISABLE;

 htsc.Init.ChannelIOs = TSC_GROUP4_IO1|TSC_GROUP4_IO2;

 htsc.Init.ShieldIOs = 0;

 htsc.Init.SamplingIOs = TSC_GROUP4_IO3;

 if (HAL_TSC_Init(&htsc) != HAL_OK)

 {

  _Error_Handler(__FILE__, __LINE__);

 }

and the MX_TOUCHSENSING_INIT does : tsl_user_Init();

After this, in my while(1) loop I have:

 tsl_status = tsl_user_Exec();

 if (tsl_status != TSL_USER_STATUS_BUSY)

 {

 Process_Sensors(tsl_status);

 }

 else if (tsl_status == TSL_USER_STATUS_BUSY){

 platformLog("USER BUSY\n");

 }

 if (TKEY_DET(0))

 {

 platformLog("Press KEY");

 }

 else if (TKEY_REL(0))

 {

 platformLog("No Key Pressed\n");

 }

I know I declared 2 inputs so I have TKEY(0) and TKEY(1), but I was trying to make it work with only one of the inputs. My Issue is that tsl_status is always Busy so the process sensors function never happens. Any ideas why would that be the case?

1 REPLY 1
NFerr.1
Associate II

Any new ideas regarding this problem? Still can't get anything else but the Busy Status.