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.

application ( should be the sum of allchannels required for all the keys ,rotorsand sliders used in the design )channels per rotor/slider ) 12 channelsCharge cycle time required for the design 5 cycles Assuming the device isconfigured with a clockfrequency of 48MhzNumber of SNS/SNSK port pairs needed 2 pairs This is determined basedon the free PIO of theboardChoice of ports available for the designSNS/SNSKPair1 portSNS1 Port: ASNSK1 Port: AThe choice of ports forthe port pairs is limitedand can be found in thesection 5.7.1.5SNS/SNSKPair 2 portSNS2 Port: BSNSK2 Port: BGiven the above requirements for the applications, the first step is to select the right libraryvariant required.Step 1: Selecting the right library variantReferring to the library selection guide, we see that there are a few variants of libraries supportedfor AT91SAM3S. One library is for IAR and the other is for GNU. If we want to use IARWorkbench, we use the library name: libsam3s-32qt-k-8rs-iar.a.Step 2: Defining the constants / symbols in the project spaceIn IAR, change preprocessor options by adding the good defines:_TOUCH_ARM__QTOUCH_SNS1=BSNSK1=BSNS2=ASNSK2=AQT_NUM_CHANNELS=32_ROTOR_SLIDER_QT_DELAY_CYCLES=10_SNS1_SNSK1_SAME_PORT__SNS2_SNSK2_SAME_PORT_Alternatively, you can have them defined in a separate header file.Step3: Usage of library API’sNow, you can use the touch API’s to create, initialize and perform touch sensing.Checklist of items for integrating <strong>QTouch</strong> acquisition method librariesThe following is a checklist of items which needs to be ensured when integrating <strong>QTouch</strong>acquisition method libraries• The clock prescaler register (e.g. CLKPR, XDIV) needs to be configured correctly basedon the device selected. Some devices have clock frequency selection based on fuses. Ithas to be ensured the fuses are set correctly in such cases.55

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

Saved successfully!

Ooh no, something went wrong!