Atmel AVR262: Atmel QTouch with USB HID Features 8-bit Atmel Microcontrollers • Single-chip solution ® ® ® - Atmel QTouch and USB HID on the Atmel AVR AT90USB646 • Using QTouch Library - Eight QTouch keys Application Note - Customized firmware using the Atmel QTouch Library •...
Atmel AVR262 3 Application overview This demo application acquires the QTouch key sensed, generates the report, and sends it to a PC (host) on request. The application is built over the generic USB HID application, which allows a simple data exchange between the PC (host) and the device.
Page 4
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 the remaining sensors are treated similarly. Atmel AVR262 8375A-AVR-03/11...
(which are device and compiler specific) need to be integrated with other source files. To select the correct device and application-specific library files, refer to the Library_Selection_Guide.xls file in the Atmel QTouch library root folder. The library selection guide is also available on the Atmel website.
Project Options, select the C/C++ Compiler category, and on the Preprocessor tab, the following options should be provided, as shown in Figure 5-2. The same options should be added in the Assembler category on the Preprocessor tab, as shown in Figure 5-3. Atmel AVR262 8375A-AVR-03/11...
Page 7
Atmel AVR262 Figure 5-2. IAR compiler options. Figure 5-3. IAR assembler options. 8375A-AVR-03/11...
The various related functions can be grouped into three main categories. The necessary functions are explained under each relevant category. • Functions related to initialization • Touch library APIs • HID report generation Atmel AVR262 8375A-AVR-03/11...
CHANNEL_6, AKS_GROUP_1, 10u, HYST_6_25 ); qt_enable_key( CHANNEL_7, AKS_GROUP_1, 10u, HYST_6_25 ); Refer to the Atmel QTouch user guide 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.
Atmel AVR262 6.3 HID report generation 6.3.1 hid_report_in Whenever the host requests data, the device responds accordingly. If there is no new data, the device sends a NAK response. When new data is available, the device needs to send the information to the host. This function is responsible for generating the report to be sent via USB.
This application 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 key release is displayed as shown in Figure 7-1. Figure 7-1. Key status. Atmel AVR262 8375A-AVR-03/11...
Page 15
Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL...