Import Touch Project into IAR Embedded Workbench

 Objective

This article provides information on importing a QTouch® project generated from START to IAR Embedded Workbench.

 Materials

 Procedure

1

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.

2

Export

Once you've configured your project and are ready to export, ensure that the IAR Embedded Workbench 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.

ExportProject.png

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

3

Rename Pack

Rename the downloaded package from qt5_atmega324pb_xpro.atzip to qt5_atmega324pb_xpro.zip.

Rename.png

4

Extract

Create a new folder and name it qt5_atmega324pb_xpro. Then, extract the contents of qt5_atmega324pb_xpro.zip to this new folder.

5

Create New Project

Open IAR Embedded Workbench. In the top menu, select Project > Create New Project.

NewProject.png

6

Empty Project

Create an 'Empty Project' for the AVR toolchain.

EmptyProject.png

7

Name the Project

Browse for the qt5_atmega324pb_xpro folder created in Step 4 and give this newly created project a name. The project will then be created and displayed in workspace.

IARProject.png

8

Add Connections

Select Project > Add Project Connection and select 'IAR Project Connection' in the subsequent window.

ProjectConnections.png

9

Connection File

Look for the iar-project-connection.ipcf file inside the qt5_atmega324pb_xpro folder and click Open. You may ignore any warning that appears.

10

Source Files

The source files generated from START will be added to the IAR project file.

SourceFiles.png

11

General Options

Select Project > Options.

ProjectOptions.png

In 'General Options' select the 'Normal DLIB' option in the 'Library Configuration' tab.

LibraryConfiguration.png

12

Stack Memory

The stack memory set by default is not sufficient. Select the 'System' tab and update the stack size as shown below.

Stack.png

13

Output Format

Change the output format as follows:

  • Select Linker > Output.
  • Click on the Override default box and change the output file extension to .hex.
  • Under 'Format', select 'Others' and select 'intel-extended' from the drop-down menu.
  • Click OK.
Output.png

14

Initialization Code

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

15

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".

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

16

Build Project

The project is ready to be built and tested. Press F7 to build the project. If IAR Embedded Workbench asks you to save the workspace, give it a name and then click Save. The built .hex can be found in the ..\Debug\Exe\ project folder.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.