background image

Atmel AVR262

 

 

9

8375A-AVR-03/11 

6.1 Functions related to initialization 

6.1.1 config_keys 

The config_keys function is responsible for configuring the sensors as keys to the 
respective channels. 

6.1.2 CHANNEL_t 

The CHANNEL_t function specifies the channel number to be configured for a key. 

6.1.3 AKS_GROUP 

The AKS_GROUP function specifies the adjacent key suppression (AKS

®)

 group 

associated with the sensor being configured as “key.” 

6.1.4 10u 

The 10u function specifies the detect threshold for the sensor. 

6.1.5 HYST_6_25 

The HYST_6_25 function specifies the detection hysteresis for the sensor. 

    qt_enable_key( CHANNEL_0, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_1, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_2, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_3, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_4, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_5, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_6, AKS_GROUP_1, 10u, HYST_6_25 ); 
    qt_enable_key( CHANNEL_7, AKS_GROUP_1, 10u, HYST_6_25 ); 

 

 for more information on this function. 

6.1.6 qt_init_sensing 

The qt_init_sensing function is used to initialize the touch sensing for all enabled 
channels. All required sensors should be configured before calling this function. 

#define qt_init_sensing( ) qt_init_sensing_with_burst( 
BURST_FUNC_NAME ,CALCULATE_MASKS) 

6.1.7 qt_set_parameters 

The qt_set_parameters function is used to initialize the global configuration settings in 
the variable qt_config_data of the QTouch acquisition method libraries. In other 
words, this will fill the default threshold values in the configuration data structure. 

 

 

 

Summary of Contents for AVR262

Page 1: ...ability for different AVR USB devices Supports IAR and GCC 1 Introduction This application note illustrates how to use the QTouch Library on the AT90USB646 microcontroller to provide a single chip sol...

Page 2: ...2 Atmel AVR262 8375A AVR 03 11 2 Hardware requirements Atmel STK 600 Atmel STK525 or custom board Atmel QTouch sensor board USB host...

Page 3: ...Application overview The reports sent to the host contain a set of bytes that can be used by the user application Because this application is using just eight QTouch keys one byte is sufficient to tra...

Page 4: ...Touch data in report byte When a touch is sensed on a sensor connected to PA0 PA1 the value of the report byte is 0x01 and when it is sensed at PC4 PC5 the value is 0x40 The report byte values for th...

Page 5: ...root folder The library selection guide is also available on the Atmel website Select the technology as QTouch the MCU family as USB AVR the MCU type as 8 bit the MCU as Atmel AT90USB646 the tool chai...

Page 6: ...ese custom compilation options one by one refer to Figure 5 1 D_QTOUCH_ DQT_NUM_CHANNELS 8 DSNS1 A DSNSK1 A DSNS2 C DSNSK2 C DQT_DELAY_CYCLES 5 D_SNS1_SNSK1_SAME_PORT_ D_SNS2_SNSK2_SAME_PORT_ DQTOUCH_...

Page 7: ...Atmel AVR262 7 8375A AVR 03 11 Figure 5 2 IAR compiler options Figure 5 3 IAR assembler options...

Page 8: ...he help of a block diagram Figure 6 1 Firmware architecture The touch sensing and report generation are handled in hid_task c and touch_task c and their respective header files The various related fun...

Page 9: ...NEL_2 AKS_GROUP_1 10u HYST_6_25 qt_enable_key CHANNEL_3 AKS_GROUP_1 10u HYST_6_25 qt_enable_key CHANNEL_4 AKS_GROUP_1 10u HYST_6_25 qt_enable_key CHANNEL_5 AKS_GROUP_1 10u HYST_6_25 qt_enable_key CHAN...

Page 10: ...by the user qt_set_parameters configure timer ISR to fire regularly init_timer_isr 6 2 Touch library APIs 6 2 1 touch_measure The touch_measure function is responsible for measuring the touch sensing...

Page 11: ...he value of the touch_data variable changes and the host is updated with the new status Usb_select_endpoint EP_HID_IN if Is_usb_write_enabled return Not ready to send report if touch_data old_touch_da...

Page 12: ...note includes a GUI based PC host application that can be used to display which key is pressed or released The PC executable is available in the associated deliverables The respective key press or ke...

Page 13: ..._id 2725 Atmel AVR QTouch Library 4 3 http www atmel com dyn products tools_card asp tool_id 4627 Atmel AVR QTouch Library User Guide http www atmel com dyn resources prod_documents doc8207 pdf AVR328...

Page 14: ...tions 6 6 Firmware 8 6 1 Functions related to initialization 9 6 1 1 config_keys 9 6 1 2 CHANNEL_t 9 6 1 3 AKS_GROUP 9 6 1 4 10u 9 6 1 5 HYST_6_25 9 6 1 6 qt_init_sensing 9 6 1 7 qt_set_parameters 9 6...

Page 15: ...his document or in connection with the sale of Atmel products EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISC...

Reviews: