Frequency Hop Module
The Frequency Hop module helps the touch controller avoid interference from external noise sources (such as power lines, switching power supplies, or other electronic devices) that can affect touch detection accuracy. It achieves this by dynamically changing (or "hopping") the acquisition frequency used for touch measurements. By cycling through multiple frequencies, the system can minimize the impact of noise that may be present at a specific frequency.
Frequency Hop Typedefs and Data Structures
qtm_freq_hop_config_t
uint16_t num_sensors;
uint8_t num_freqs;
uint8_t *freq_option_select;
uint8_t *median_filter_freq;
} qtm_freq_hop_config_t;
Description: Frequency Hop configuration 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 | 2/4 bytes | N/A | The pointer to the acquisition library frequency selection parameter |
| *median_filter_freq | 2/4 bytes | N/A | The pointer to the array of selected frequencies |
qtm_freq_hop_data_t
{
uint8_t module_status;
uint8_t current_freq;
uint16_t *filter_buffer;
qtm_acq_node_data_t *qtm_acq_node_data;
} qtm_freq_hop_data_t;
Description: Frequency Hop data structure
More Info: The follow describes the individual members of the 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 | 2/4 bytes | N/A | The pointer to the filter buffer array for measured signals |
| *qtm_acq_node_data | 2/4 bytes | N/A | The pointer to the node data structure of the acquisition group |
qtm_freq_hop_control_t
{
qtm_freq_hop_data_t (*qtm_freq_hop_data);
qtm_freq_hop_config_t (*qtm_freq_hop_config);
} qtm_freq_hop_control_t;
Description: Frequency Hop combined configuration and data structure
Frequency Hop Frequency Selection
The Frequency Hop module achieves better noise immunity by cycling through a series of acquisition frequencies to avoid noise at any one sampling frequency. It varies the acquisition frequency by inserting a delay of 0 to 15 PTC clocks into the acquisition cycle. For example, the table below illustrates the list of supported frequencies for a PTC clock of 4 MHz.
| PTC Frequency Delay Cycles | Acquisition Frequency (kHz) | |
|---|---|---|
| 0 | FREQ_SEL_0 | 66.67 |
| 1 | FREQ_SEL_1 | 62.5 |
| 2 | FREQ_SEL_2 | 58.82 |
| 3 | FREQ_SEL_3 | 55.56 |
| 4 | FREQ_SEL_4 | 52.63 |
| 5 | FREQ_SEL_5 | 50 |
| 6 | FREQ_SEL_6 | 47.62 |
| 7 | FREQ_SEL_7 | 45.45 |
| 8 | FREQ_SEL_8 | 43.48 |
| 9 | FREQ_SEL_9 | 41.67 |
| 10 | FREQ_SEL_10 | 40 |
| 11 | FREQ_SEL_11 | 38.46 |
| 12 | FREQ_SEL_12 | 37.04 |
| 13 | FREQ_SEL_13 | 35.71 |
| 14 | FREQ_SEL_14 | 34.48 |
| 15 | FREQ_SEL_15 | 33.33 |
| 16 | FREQ_SEL_SPREAD | Variable frequencies |
Frequency Hop APIs
qtm_freq_hop
Description:
Performs Frequency Hopping Algorithm
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()
Parameter:
| Type | Description. |
|---|---|
| qtm_freq_hop_control_t* | Pointer to Frequency Hop Control structure. |
Return:
| Type | Description. |
|---|---|
| touch_ret_t | Touch Library Return Status |
qtm_get_freq_hop_module_id
Description: Returns the module ID
Parameter:
| Type | Description. |
|---|---|
| None | None. |
Return:
| Type | Description. |
|---|---|
| uint16_t | Module ID |
qtm_get_freq_hop_module_ver
Description: Returns the module Firmware version
Parameter:
| Type | Description. |
|---|---|
| None | None. |
Return:
| Type | Description. |
|---|---|
| uint8_t | Module version |