Frequency Hop Auto-Tune Module
The Frequency Hop Auto-Tune module in Microchip’s Touch Modular Library is designed to automatically optimize the acquisition frequencies used for capacitive touch sensing. This feature enhances noise immunity by dynamically selecting the best frequencies for touch measurements, reducing the impact of environmental interference.
Frequency Hop Autotune Typedefs and Structures
qtm_freq_hop_autotune_config_t
{
uint16_t num_sensors;
uint8_t num_freqs;
uint8_t *freq_option_select;
uint8_t *median_filter_freq;
uint8_t enable_freq_autotune;
uint8_t max_variance_limit;
uint8_t autotune_count_in_limit;
}qtm_freq_hop_autotune_config_t;
Description: Frequency Hop Auto-Tune Nodule Configuration
More Info: Here is a description of each of the elements in this structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| num_sensors | 1 byte | 0 – 255 | The number of sensors to buffer data for the median filter |
| num_freqs | 1 byte | 3-to-7 | The number of frequencies to cycle/depth of the median filter |
| *freq_option_select | Pointer 2/4 bytes | Pointer | Pointer to the acquisition library frequency selection parameter |
| *median_filter_freq | Pointer 2/4 bytes | Pointer | Pointer to the array of frequencies to be used on median filter samples |
| enable_freq_autotune | 1 byte | 0 or 1 | Disable (0) or enable (1) automatic retuning of hop frequencies |
| max_variance_limit | 1 byte | 1-to-255 | Signal variance required to trigger retuning of hop frequency |
| Autotune_count_in | 1 byte | 1-to-255 | The number of occurrences of max_variance_limit to trigger returning of hop frequency |
qtm_freq_hop_autotune_data_t
{
uint8_t module_status;
uint8_t current_freq;
uint16_t *filter_buffer;
qtm_acq_node_data_t *qtm_acq_node_data;
uint8_t *freq_tune_count_ins;
}qtm_freq_hop_autotune_data_t;
Description: Frequency Hop Auto-Tune Module Status Data
More Info: Here is a description of each of the elements in this structure:
| Parameter | Size | Range/Options | Usage |
|---|---|---|---|
| module_status | 1 byte | N/A | Module status – N/A |
| current_freq | 1 byte | 0-to-15 | Current frequency step |
| *filter_buffer | Pointer 2/4 bytes | Pointer | The pointer to the filter buffer array for measured signals |
| *qtm_acq_node_data | Pointer 2/4 bytes | Pointer | The pointer to the node data structure of the acquisition group |
| *freq_tune_count_ins | Pointer 2/4 bytes | Pointer | Pointing to the counter array to trigger frequency change |
qtm_freq_hop_autotune_data_t
{
qtm_freq_hop_autotune_data_t (*qtm_freq_hop_autotune_data);
qtm_freq_hop_autotune_config_t (*qtm_freq_hop_autotune_config);
} qtm_freq_hop_autotune_control_t;
Description: Frequency Hop Auto-Tune Module combination of configuration and status data
Frequency Hop Autotune Application Programming Interfaces (APIs)
qtm_freq_hop_autotune
*qtm_freq_hop_autotune_control);
Description: Performs the frequency hopping auto-tune algorithm.
Parameter: qtm_freq_hop_autotune_control_t *qtm_freq_hop_autotune_control - Pointer to Frequency Hop Autotune Control Structure
Return: touch_ret_t
More Info: The algorithm does the following:
- Measure noise in the signal value and based on the noise level, change the frequency-set used for acquisition.
- Choose the next measurement's frequency from the frequency-set and perform median filter on the signal value (should be called after calling qtm_acquisition_process())
qtm_get_freq_auto_module_id
Description: Returns the Module ID
Parameter: void
Return: uint16_t Module ID
qtm_get_freq_auto_module_ver
Description: Returns the Module Firmware Version
Parameter: void
Return: uint8_t Module Firmware Version - Upper nibble major / Lower nibble minor