Import Touch Project into Microchip Studio

Last modified by Microchip on 2023/11/09 08:55

Objective

This article provides information on importing a QTouch® project generated from START to Atmel® Studio.

Materials

Software Tools

Note: Atmel Studio in now Microchip Studio for AVR® and SAM Devices

Procedure

Create a QTouch Project

Go to START and create your QTouch project. Detailed information on how to create a QTouch project in START can be found on the Generate User Board Touch Project page.


Export

Once you've configured your project and are ready to export, ensure that the Atmel Studio option is selected. In this example, the project name is qt5_atmega324pb_xpro. We will be referencing this project throughout the rest of the step-by-step instructions on this page.

Screenshot of the Export Project dialog box in START with Atmel Studio selected

Download the pack to the desired folder by clicking on the DOWNLOAD PACK button. By default, it downloads to C:\Users\user-name\Downloads.


Open Atmel Studio

After you open Atmel Studio, select File > Import > Atmel Start Project.

Screenshot of clicking on 'File>Import>Atmel Start Project' in Studio


Atmel Start Importer
  • Browse and select the downloaded .atzip file
  • Browse and select the desired project location
  • Provide a project name
  • Click OK to generate the project

Screenshot of Studio Importer dialog box


Project Creation

Project will be created and all files included.

Screenshot of Solution Explorer with all files after project creation


Initialization Code

By default, only the initialization code is called in main() as shown below.

1
2
3
4
5
6
7
8
9
int main(void)
{
   /* Initializes MCU, drivers and middleware */
    atmel_start_init();

   /* Replace with your application code */
   while(1) {
    }
}

Modify main()

Modify the content of main.c as follows.
Include touch_example.h file at the top of the main file after inclusion of atmel_start.h file as #include "touch_example.h" .

1
2
3
4
5
6
7
8
9
10
11
12
13
#include "touch_example.h"

int main(void)
{
   /* Initializes MCU, drivers and middleware */
    atmel_start_init();

   /* Replace with your application code */
   while (1) {

        touch_example();
    }
}

Note: An example on using the touch APIs and getting touch sensor state is given in the touch_example.c file.


Build Project

The project is ready to be built and tested. Press F7 to build the project.
The built .hex can be found in the ..\Debug\ project folder.

Back to Top