Criteria |
Selection |
Notes |
|
---|---|---|---|
Microcontroller |
AT91SAM3S |
||
IDE and compiler tool chain used |
IAR Workbench and GNU compiler |
The GCC compiled variant of the libraries for the device selected needs to be used. |
|
Number of Keys required for the application |
3 |
Each key requires 1 QTouch acquisition channel |
|
Rotors and sliders required |
Yes |
||
Number of Rotors and Sliders required |
3 |
Each rotor / slider will require 3 channels. |
|
Number of Channels required for the application ( should be the sum of all channels required for all the keys ,rotors and sliders used in the design ) |
12 |
3 Keys + ( 3 rotors x 3 channels per rotor/slider ) 12 channels |
|
Charge cycle time required for the design |
5 cycles |
Assuming the device is configured with a clock frequency of 48Mhz |
|
Number of SNS/SNSK port pairs needed |
2 pairs |
This is determined based on the free PIO of the board |
|
Choice of ports available for the design |
SNS/ SNSK Pair1 ports |
SNS1 Port : A |
|
SNSK1 Port : A |
|||
SNS/ SNSK Pair 2 ports |
SNS2 Port : B |
||
SNSK2 Port : B |
Given the above requirements for the applications, the first step is to select the right library variant required.
Step 1: Selecting the right library variant
Referring to the library selection guide, we see that there are a few variants of libraries supported for AT91SAM3S. One library is for IAR and the other is for GNU. If we want to use IAR Workbench, we use the library name: libsam3s-32qt-k-8rs-iar.a.
Step 2: Defining the constants / symbols in the project space
In IAR, change preprocessor options by adding the good defines:
_TOUCH_ARM_
_QTOUCH_
SNS1=B
SNSK1=B
SNS2=A
SNSK2=A
QT_NUM_CHANNELS=32
_ROTOR_SLIDER_
QT_DELAY_CYCLES=10
_SNS1_SNSK1_SAME_PORT_
_SNS2_SNSK2_SAME_PORT_
Step3: Usage of library API’s
Now, you can use the touch API’s to create, initialize and perform touch sensing.