Generate User Board Touch Project
Objective
The following lab shows you how to create a QTouch® project in Atmel START where you can graphically add sensors and configure QTouch parameters. The resulting project supports GCC and IAR compilers. This project is generated to use ATmega324PB Xplained Pro along with QT5 Xplained Pro Extension Kit.
Reference Materials
Procedure
Open Atmel Start
Go to Microchip's Atmel START page and select the CREATE NEW PROJECT option.
Select Device and Create New Project
Start typing "atmega324pb" in the Filter on device… box. Select ATmega324PB-MN then click on CREATE NEW PROJECT.
Add Software Components
After project creation, the project dashboard will open as follows. Click Add software component to add the QTouch Library.
You can type "touch" in the Filter box to be able to find the library faster. Add the QTouch Library by clicking the + icon and then clicking on Add component(s).
QTouch Library Middleware will be added to the project.
Add Sensors
The QT5 Xplained Pro has two mutual capacitance buttons and one mutual capacitance slider that will be added to the project, but to do so you must first open the QTouch Configurator.
Open the Configurator
- First, in the Project Dashboard, click on the QTouch Library button under My Project which will open the Library setup panel.
- Next, in the QTouch Library panel, click on Open QTouch Configurator to open the Configurator GUI.
Adding Button
- Select the QTouch tab and then click on the Button drop-down menu.
- Select Mutualcap as the Technology and 2 as the Number of buttons.
- Click Add button.
Adding Slider
- Click on the Slider drop-down menu.
- Select Mutualcap as the Technology and 1 as the Number of sliders.
- Enter the Number of Channels per slider.
- Click Add button.
Check Slider Button Count
The slider in QT5 is composed of four buttons.
- Select the Slider and click on Settings gear icon and ensure that Number of Buttons is 4 and if not, change it to 4 and click Apply.
Pin Assignment and Touch Data Debug Interface
Refer to the following ATmega324PB Xplained Pro EXT1 header and QT5 Xplained Pro documents for connection details.
Based on the design files, the X and Y lines should be selected as follows.
Touch Pin Assignment
Select the Pins tab and select the correct X and Y lines for buttons and slider.
- Drag and drop the channels to the required combination of X and Y.
- Click on the channel displayed as X(Y) or Y(X) to toggle X to Y or Y to X.
- The Matrix View is only provided in case of mutual cap in order to quickly drag and drop the sensors and configure the pins.
Click on Matrix View to switch to Table View and assign the X, Y pins from the drop-down list for each sensor. Click on Table View to switch back to Matrix View.
Driven Shield Pin Assignment
Click on the Driven Shield tab to configure the driven shield pin.
- It is enabled for the supported devices.
Touch Data Debug Interface
Click on the Debug tab to configure the Data Streamer (UART) pins, which can be configured as shown in the accompanying image. Enable Data Streamer and modify the UART pins as shown.
Basic Parameters
Select the Parameters tab.
Channel
The 'Channel' tab allows you to configure touch channel properties such as Oversamples (filter level), Digital Gain, Analog Gain, Series Resistor, CSD (additional cycles), Prescaler, Threshold, Hysteresis, and AKS_GROUP (adjacent key suppression).
Sensor
Click on the Sensor tab to configure sensor parameters such as Detect Integration, Away from Touch Recal Count, Away from Touch Recalibration Threshold, Touch Drift Rate, Away from Touch Drift Rate, Drift Hold Time, Re-burst mode, Max on Duration, Scan Rate and Acquisition Frequency.
Scroll Down the sensor page to configure Noise Handling. Frequency Hop can be enabled by selecting the Enable Frequency Hop checkbox. You can select up to seven Frequency Steps and then configure the Hop Frequencies from the drop-down list. Hop Frequencies are fixed at compile time in Frequency Hop.
The auto-tune feature can be enabled by selecting the Enable Frequency Auto Tuning checkbox. Hop Frequencies are tuned by the library at runtime as per the Auto Tune Parameters thresholds configured during noisy conditions.
Sliders
Click on the 'Sliders' tab to configure slider parameters such as Resolution, Dead Band, Position Hysteresis and Detect Threshold as shown below.
The Sliders tab will be displayed as Sliders and Wheels if both sliders and wheels are configured, whereas it is displayed as Wheels when Wheels only are configured.
Notifications
Click on the Notifications tab to check if there are any warnings or guidelines from START.
Summary
Click on the Summary tab to review the project configuration and download the summary.
Export
After completing the configuration, click the EXPORT PROJECT option.
Microchip Studio is enabled by default. Select IAR Embedded Workbench if required for the project, enter the file name and click Download Package.
Results
Once you have finished configuring your project and are ready to export, you can either export to IAR or to Microchip Studio to start writing your application code.