atmel qtouch features...1.1 atmel studio 6 atmel studio 6 is a professional integrated development...

23
APPLICATION NOTE Atmel AT03075: Getting Started with SAM4L Using QTouch Composer Atmel QTouch Features Prerequisites PC platform: Windows ® 2000, Windows XP, Windows Vista ® , Windows 7 Procedure to create SAM4L QTouch ® Project using the Project Builder wizard Estimated time to complete all tasks in this guide: 1 hour 42135ASAM05/2013

Upload: others

Post on 27-Feb-2021

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

APPLICATION NOTE

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer

Atmel QTouch

Features

• Prerequisites

• PC platform: Windows® 2000, Windows XP, Windows Vista®, Windows 7

• Procedure to create SAM4L QTouch® Project using the Project Builder wizard

• Estimated time to complete all tasks in this guide: 1 hour

42135A−SAM−05/2013

Page 2: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

2

Table of Contents

1.  Introduction .......................................................................................... 3 1.1  Atmel Studio 6 ................................................................................................... 3 1.2  QTouch Library ................................................................................................. 3 1.3  QTouch Composer ............................................................................................ 3 

2.  Requirements ....................................................................................... 4 2.1  Software ............................................................................................................ 4 

3.  Getting Started with SAM4L QTouch Composer Project ..................... 5 3.1  Creating SAM4L Based QTouch Project ........................................................... 5 

3.1.2  Adding Sensors .................................................................................. 9 3.1.3  Firmware Properties.......................................................................... 12 3.1.4  Device Selection ............................................................................... 15 3.1.5  Pin Configuration .............................................................................. 16 3.1.6  Debug Interface ................................................................................ 17 

3.2  Summary ......................................................................................................... 18 

4.  References ......................................................................................... 19 

Appendix A. .............................................................................................. 20 

Appendix B.  Revision History ............................................................ 22 

Page 3: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

3

1. Introduction The purpose of this document is to get familiar with the Atmel® QTouch Composer for developing SAM4L based touch projects.

1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and SAM microcontrollers. It also comprises the programming interface of all AVR and SAM tools.

Additional features:

• Supports all Atmel AVR 8-bit and 32-bit MCUs

• Supports SAM MCUs (no simulation) (the Atmel ARM®-based microcontrollers)

• Integrated Atmel QTouch Analyzer

• Integrated C Compiler

• New Project Wizard and Intelligent Editor

• ASF support

1.2 QTouch Library QTouch Library is a software library for developing touch applications on standard Atmel AVR and SAM microcontrollers.

1.3 QTouch Composer QTouch Composer is an extension integrated into Atmel Studio 6, which enables the user to create touch projects with just a few clicks. The QTouch Composer creates the project and adds necessary files based on the inputs provided through the wizard. QTouch Composer also adds the appropriate Atmel QTouch Library.

Page 4: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

4

2. Requirements

2.1 Software Ensure that the latest version of the following is installed

• Atmel Studio 6.1 or later

• Atmel QTouch Composer extension for Atmel Studio 6.1

• Atmel QTouch Library extension for Atmel Studio 6.1

• Atmel Software Framework (ASF) version 3.8.1 or later

Steps to download the QTouch Composer and QTouch Library extensions: 1. Open the Extension Manager by selecting Tools → Extension Manager. The Extension Manager Window

opens. 2. By default, it shows the installed extensions. 3. Click the “Available Downloads” option. 4. Select “QTouch Library” and click the Download icon. 5. The “Sign in to Extension Manager Dashboard” window opens and asks you to sign-in/register. 6. If you have not registered, kindly register.

Then close the “Sign in to Extension Manager Dashboard” window. Atmel will send you a confirmation email to the email-id provided. Click the link to confirm your email-id.

7. Restart Atmel Studio. 8. Repeat steps 1-4. and the “Sign in to Extension Manager Dashboard” window opens.

Sign-in using the email-id and password used while registering. 9. The “QTouch Library” extension will download and install automatically. 10. To install the QTouch Composer, repeat steps 1-4.

Select “QTouch Composer” in the “Available Downloads” option and click the Download button. 11. The “QTouch Composer” extension will download and install automatically after signing in to Extension

Manager Dashboard.

Steps 6 and 7 are required only if you are registering for the first time. If you have already registered, provide your email-id and password. “Extension Manager Dashboard” Window closes and your download starts automatically.

QTouch Project for SAM4L can be created only when ASF is installed as a component in the Atmel Studio 6.1.

Page 5: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

5

3. Getting Started with SAM4L QTouch Composer Project This chapter explains the procedure to create a QTouch Project using the QTouch Composer for the SAM4L device.

3.1 Creating SAM4L Based QTouch Project To create a new project, open Atmel Studio 6.1 and create a new project. In Atmel Studio select File → New → Project. Refer to Figure 3-1.

Figure 3-1.

Page 6: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

6

In the New Project window, select Project Type as “GCC C QTouch Executable Project” from the installed templates as shown in Figure 3-2.

Provide a name for the project and path for the project location, and click the OK button to continue.

Figure 3-2.

Page 7: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

7

The QTouch Project Builder wizard “Getting Started” window will open as shown in Figure 3-3. Click Next to go to the Kit Design Window.

Figure 3-3.

Page 8: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

8

The Kit Design Window opens on Page 1 of the QTouch Project Builder wizard. Select the Button, Slider and Wheel sensors as necessary. If any image is available for the project, provide it by clicking the Browse button

in the Kit image under the Kit Properties. Refer to Figure 3-4. You could also modify the physical properties of the kit like Height and Width. And you can provide a name for

the kit and Id for the Project under the Kit Physical Properties.

Figure 3-4.

Page 9: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

9

3.1.2 Adding Sensors For adding Buttons, click the Button icon highlighted in Figure 3-4. Then the Add Button window pops up as

shown in Figure 3-5. Select the number of buttons required and provide the physical properties like Height and Width for the buttons.

Click Add to include the buttons selected in the project. Four buttons are added in this example.

Figure 3-5.

Page 10: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

10

For adding Slider, click the Slider icon highlighted in Figure 3-4. Then the Add Slider window pops up as shown in Figure 3-6. Select the number of sliders required and provide the slider physical properties like Height and Width.

Select the Design Type as Small, Medium or Large for the slider. If no selection is made, the design type for slider is automatically selected.

Click Add to include the slider sensor in the project. One slider is added in this example.

Figure 3-6.

Page 11: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

11

For adding Wheel, click the Wheel icon highlighted in Figure 3-4. Then the Add Wheel window pops up as shown in Figure 3-7. Select the number of wheels required and provide the wheel physical properties like Inner Radius and Outer Radius.

Select the Design Type as Small, Medium or Large for the wheel. If no selection is made, the design type for the wheel is automatically selected.

Click Add to include the wheel sensor in project. One wheel is added in this example.

Figure 3-7.

Page 12: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

12

3.1.3 Firmware Properties Once the selection of sensors is done, you can modify the firmware properties for the kit and the sensors.

Firmware properties of the kit that can be modified are Detect Integration, Negative Drift Rate, Positive Drift Rate, Maximum ON Duration, Drift Hold Time, Recalibration Threshold, Measurement Period (in milliseconds - ms), Positive Recalibration Delay and Ticks per ms. Refer to Figure 3-8.

In the QTouch Library these firmware properties are indicated as Global Specific Parameters, which means they are applicable in general to all the sensors present in the design.

Refer to the Atmel QTouch Library User Guide for more information on global specific parameters. Once you click on any parameter, the wizard also provides a brief description about the selected parameter as shown in Figure 3-8.

Figure 3-8.

Page 13: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

13

Firmware properties of the sensor that can be modified are Detect Threshold, Detect Hysteresis, AKS® Group, Channel Number, Position Resolution and Position Hysteresis. When you click on any sensor, the firmware properties of the sensor appear in the Kit Design page as shown in Figure 3-9.

In the QTouch Library these firmware properties are indicated as sensor specific parameters; which means the parameters can be altered for individual sensors.

Position Resolution and Position Hysteresis are not available as part of the button sensor configuration parameters.

Refer to the Atmel QTouch Library User Guide for more information on sensor specific parameters. Once you click on any parameter, the wizard also provides a brief description about the selected parameter as shown in Figure 3-9.

Once the modification of firmware properties for kit and sensor is made, click Next to continue.

Figure 3-9.

Page 14: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

14

The next page is the guide for Touch technology selection for the new users, as shown in Figure 3-10.

Based on inputs provided for the questions in the technology selection page, it suggests the suitable technology to be used for the requirements as either QTouch or QMatrix.

This is an optional suggestion; the user need not necessarily follow this recommendation strictly. Click Next to go to the next page in QTouch Project Builder wizard.

Figure 3-10.

Page 15: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

15

3.1.4 Device Selection In the Device Selection page, the wizard lists the supported devices based on sensor selection.

Select the Technology as ‘QTouch’, Device Family as ‘SAM4L’ and Device Name as ‘ATSAM4LC4C’, as shown in Figure 3-11. Click Next to continue.

Figure 3-11.

Page 16: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

16

3.1.5 Pin Configuration In the Pin Configuration page, GPIO pins for sensors need to be assigned. The Hardware Capacitive Touch Module (CATB) in the SAM4L device requires one GPIO pin per sensor and a common discharge pin for all the sensors.

Select the Sensing Pair and Port Pin as required for the chosen sensors as shown in Figure 3-12. Also select a common Discharge Port Pin, among the available options in the drop-down list. Click Next to continue.

Sensing Pair:

The SAM4L device supports 32 touch channels. The CATB module in the SAM4LC device provides two GPIO pins as selectable option for each channel, and is indicated as sensing pair.

In total there are 32 sensing pairs and the user need to select one sensing pair per channel and can select anyone of the two GPIO pins available for the selected sensing pair.

Refer to Appendix A for information on sensing pair and discharge pin options available in the SAM4L device.

Figure 3-12.

Page 17: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

17

3.1.6 Debug Interface Enable Debug Interface if required and configure the debug interface pins among the available port pins for debugging as shown in Figure 3-10.

The QTouch Project Builder wizard lists the unused pins (pins that are used for touch sensors) of each port in the dropdown list, that can be used for debug interface.

In case the same pin is used for two different purposes the wizard will show an error and the user will not be able to proceed to next page before the pin usage issue has been fixed.

Figure 3-13.

Page 18: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

18

3.2 Summary Finally the Summary Page appears listing all the touch configuration inputs provided in the QTouch Project Builder wizard, to create a QTouch Project using the SAM4L device, as shown in Figure 3-11.

Ensure that the Summary page contents displayed are as per your inputs and click the Finish button to create the SAM4L QTouch Project. If any corrections are required, click the Back button and make the necessary change/s.

Once you hit Finish, the QTouch Composer creates the QTouch Project with the required source, header files and the corresponding touch library. The user can build the project and load the hex file generated in the hardware test setup. By using the QTouch Analyzer the user can analyze the real time touch data.

Figure 3-14.

Page 19: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

19

4. References • SAM4L Device Datasheet

• Atmel QTouch Library User Guide

Page 20: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

20

Appendix A.

Table A-1. Sensing Pair and Multiplexed Pin Options Available.

Sensing Pair Option 1 Option 2

S0 PA4 PB13

S1 PA5 PB14

S2 PA6 PB15

S3 PA7 PC0

S4 PA8 PC1

S5 PA9 PC2

S6 PA10 PC3

S7 PA11 PC4

S8 PA13 PC6

S9 PA14 PC7

S10 PA15 PC8

S11 PA16 PC9

S12 PA17 PC10

S13 PA18 PC11

S14 PA19 PC12

S15 PA20 PC13

S16 PA21 PC15

S17 PA22 PC16

S18 PA24 PC17

S19 PA25 PC18

S20 PA26 PC19

S21 PB0 PC20

S22 PB1 PC21

S23 PB2 PC22

S24 PB4 PC24

S25 PB5 PC25

S26 PB6 PC26

S27 PB7 PC27

S28 PB8 PC28

S29 PB9 PC29

S30 PB10 PC30

S31 PB11 PC31

Page 21: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

21

Table A-2. Discharge Pin Options Available.

S. No Options

1 PA2

2 PA12

3 PA23

4 PB3

5 PB12

6 PC5

7 PC14

8 PC23

Page 22: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel AT03075: Getting Started with SAM4L Using QTouch Composer [APPLICATION NOTE] 42135A−SAM−05/2013

22

Appendix B. Revision History Doc. Rev. Date Comments

42135A 05/2013 Initial document release

Page 23: Atmel QTouch Features...1.1 Atmel Studio 6 Atmel Studio 6 is a professional Integrated Development Environment (IDE) for writing, simulating and debugging applications for AVR® and

Atmel Corporation 1600 Technology Drive San Jose, CA 95110 USA Tel: (+1)(408) 441-0311 Fax: (+1)(408) 487-2600 www.atmel.com

Atmel Asia Limited Unit 01-5 & 16, 19F BEA Tower, Millennium City 5 418 Kwun Tong Road Kwun Tong, Kowloon HONG KONG Tel: (+852) 2245-6100 Fax: (+852) 2722-1369

Atmel Munich GmbHBusiness Campus Parkring 4 D-85748 Garching b. Munich GERMANY Tel: (+49) 89-31970-0 Fax: (+49) 89-3194621

Atmel Japan G.K.16F Shin-Osaki Kangyo Building 1-6-4 Osaki, Shinagawa-ku Tokyo 141-0032 JAPAN Tel: (+81)(3) 6417-0300 Fax: (+81)(3) 6417-0370

© 2013 Atmel Corporation. All rights reserved. / Rev.: 42135A−SAM−05/2013

Atmel®, Atmel logo and combinations thereof, AKS®, AVR®, Enabling Unlimited Possibilities®, QTouch®, and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Windows® is a registered trademark of Microsoft Corporation in U.S. and or other countries. ARM® is a registered trademark of ARM Ltd. Other terms and product names may be trademarks of others.

Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.