11.07.2015 Views

Atmel QTouch Library User Guide

Atmel QTouch Library User Guide

Atmel QTouch Library User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

If the microcontroller is only used for Touch detection then running at the lowest frequencypossible for the desired touch response may provide the best power and EMC performance. If itis also used for other functions then running at a higher frequency may be necessary. In somepower critical applications it may be worth switching the frequency on the fly, such as lowering thefrequency during touch detect API instead of using long cycle times, and then switching to ahigher frequency for non-touch code. It is necessary to carefully design timer operation whenchange frequencies.InterruptsThe library disables interrupts for time-critical periods during touch sensing. These periods aregenerally only a few cycles long, and so host application interrupts should remain responsiveduring touch sensing. However, any interrupt service routines (ISRs) during touch sensing shouldbe as short as possible to avoid affecting the touch measurements or the applicationresponsiveness. As a rule of thumb, the combined durations of any ISRs during a capacitivemeasurement should be less than 1 msec,i.e., the <strong>QTouch</strong> acquisition cannot be pre-empted formore than 1msec. This can be tested during system development by checking the acquisitionduration on the touch channels on an oscilloscope. If the total burst duration for any channelvaries by more than 1ms while the user is not touching any sensors, then ISRs could adverselyaffect the measurements. Please note that none of the API functions should be called from a userinterrupt.Integrating <strong>QTouch</strong> libraries in your applicationThis section illustrates the key steps required in integrating the <strong>QTouch</strong> library in your application.Directory structure of the library filesThe <strong>QTouch</strong> library directory structure is as listed belowWhat Where CommentsRootinstallationDefault directory isC:\ProgramFiles\<strong>Atmel</strong>\<strong>Atmel</strong>_<strong>QTouch</strong>_Libraries_4.x\Generic_<strong>QTouch</strong>_LibrariesThis is the defaultdirectory path but the usercan install the directory indesired location.Header file ..\include touch_api.h is located inthisdirectory.touch_api_2kdevic.h for 2K devices supportis also added in thisdirectoryConfiguration andassemblerroutinesforacquisition<strong>QTouch</strong> acquisitionmethod libraries8-bitdevices..\<strong>Atmel</strong>_<strong>QTouch</strong>_Libraries_4.x\Generic_<strong>QTouch</strong>_Libraries\AVR_Tiny_Mega_XMega\<strong>QTouch</strong>\common_filestouch_qt_config.hqt_asm_tiny_mega.Sqt_asm_xmega.Stouch_qt_config_2kdevice.hqt_asm_tiny_mega_2kdevice.SUC3ATSAMNot needed for UC3 devicesNot needed for ATSAM devices49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!