How to change channel of TSC?
Hello Everyone!
I have thoroughly understood touch sense controller peripheral of STM32F051C8T6, I have also developed a test code using the HAL layer and is working file and detecting touch (i.e. is count value decreasing when finger comes near electrode). I have also read the TSC section of reference manual several times. I am unable to understand how to change the channel of acquisition within a group.
Right now what is happening is that I have enabled all three pins of IO group 2 as input electrode and the final (4th) one has the SAMPLING CAPACITOR connect to it. But the aquisition process always aquire the first channel only.
I am NOT able to find any function in HAL lib to change channel NOR I am able to find any register that controls that.
Some where it is written that acquisition within a group is sequential, but it is NOT also happening, each time only channel 1 is acquired.
TscHandle.Instance = TSC;
TscHandle.Init.AcquisitionMode = TSC_ACQ_MODE_NORMAL;
TscHandle.Init.CTPulseHighLength = TSC_CTPH_2CYCLES;
TscHandle.Init.CTPulseLowLength = TSC_CTPL_2CYCLES;
TscHandle.Init.IODefaultMode = TSC_IODEF_OUT_PP_LOW;
TscHandle.Init.MaxCountInterrupt = DISABLE;
TscHandle.Init.MaxCountValue = TSC_MCV_16383;
TscHandle.Init.PulseGeneratorPrescaler = TSC_PG_PRESC_DIV16;
TscHandle.Init.SpreadSpectrum = DISABLE;
TscHandle.Init.SpreadSpectrumDeviation = 127;
TscHandle.Init.SpreadSpectrumPrescaler = TSC_SS_PRESC_DIV1;
TscHandle.Init.SynchroPinPolarity = TSC_SYNC_POLARITY_FALLING;
TscHandle.Init.ChannelIOs =TSC_GROUP2_IO1|TSC_GROUP2_IO2|TSC_GROUP2_IO3;
TscHandle.Init.SamplingIOs = TSC_GROUP2_IO4;
TscHandle.Init.ShieldIOs = 0;
HAL_TSC_Init(&TscHandle);