Microchip ATSAMD21J15 Handleiding


Lees hieronder de 📖 handleiding in het Nederlandse voor Microchip ATSAMD21J15 (44 pagina's) in de categorie Niet gecategoriseerd. Deze handleiding was nuttig voor 27 personen en werd door 2 gebruikers gemiddeld met 4.5 sterren beoordeeld

Pagina 1/44
TRAINING MANUAL
Single-slope PWM Implementation using SAM D21 TCC in
a Touch- based Application
AN- 9232
Prerequisites
Hardware Prerequisites
Atmel® SAM D21 Xplained Pro Evaluation Kit
Atmel KitQT1 Xplained Pro
USB Micro Cable (TypeA/ -B) Micro
Software Prerequisites
Atmel Studio 6.2 or higher
Atmel Software Framework 3.1 .0 or higher7
Atmel QTouch® Composer 5.3 or higher
Atmel QTouch Library 5.3 or higher
Documentation Prerequisites
Atmel- - - - - - - -42271 Introduction to QTouch Design Parameters using
SAM- - - - -D21 Xplained Pro_Training Manual_AN 7846 Training Manual
Estimated completion time: 60min.
Introduction
The goal of this hands on is to:-
Create a Touch proje using QTouch Project Builderct
Use QTouch Analyzer to test the project
Implement a PWM signal using the SAM D21 Timer/Counters for Control
peripheral the brightness (TCC) to drive of a LED
Modify the utton LED brightness in relation to the Touch Delta value of a B
sensor by updating the PWM duty cycle
42327 A 07/2014
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 442 of
Table of Contents
Prerequisites .....................................................................................1
Introduction .......................................................................................1
Icon Key Identifiers ...........................................................................3
1. Training Module Architecture .....................................................4
1.1 Atmel Studio Extension (.vsix) ............................................................. 4
1.2 Atmel Training Executable (.exe) ......................................................... 4
2. Introduction ................................................................................5
3. Assignment 1: Create a Touch project using QTouch Project
Builder ........................................................................................6
3.1 Project Creation ................................................................................... 6
3.2 Conclusion ......................................................................................... 18
4. Assignment 2: Use QTouch Analyzer to Test the Project ........ 19
4.1 Connect the Kit to QTouch Analyzer ................................................. 19
4.2 Test the Proximity Effect of the QTouch Application ......................... 23
4.3 Conclusion ......................................................................................... 24
5. Assignment 3: Implement a PWM Signal using the SAM D21
Timer/Counters for Control Application Peripheral (TCC) ........ 25
5.1 Introduction to Timer/Counters for Control Application (TCC) ........... 25
5.2 TCC Peripheral Initialization Using ASF Quick Start Guide. ............. 27
5.3 Conclusion ......................................................................................... 34
6. Assignment 4: Use QTouch Button to Control LED Brightness 35
6.1 Reading and using Button Touch Delta Value ................................... 35
6.2 Using PWM to Control LED Brightness ............................................. 37
6.3 Conclusion ......................................................................................... 41
7. Conclusion ............................................................................... 42
8. Revision History ....................................................................... 43
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 443 of
Icon Key Identifiers
Delivers contextual information about a specific topic.
Highlights useful tips and techniques.
Highlights objectives to be completed.
Highlights the expected result of an assignment step.
Indicates important information.
Highlights actions to be executed out of the target when
necessary.
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 444 of
1. Training Module Architecture
This training material can be retrieved through different Atmel deliveries:
As an Atmel Studio Extension ( file) usually found on the Atmel Gallery web site .vsix
( http://gallery.atmel.com/) or using the Atmel Studio Extension manager
As an Atmel Training Executable ( file) usually provided during Atmel Training sessions.exe
Depending on the delivery type, the different resources needed by this training material (hands-on
documentation, datasheets, application notes, software, and tools) will be found on different locations.
1.1 Atmel Studio Extension (.vsix)
Once the extension installed, you can open and create the different projects using New Example Project
from ASF..." in Atmel Studio.
The projects installed from an extension are usually under “Atmel Training >
Atmel Corp. Extension Name” .
There are different projects which can be available depending on the extension:
Hands-on Documentation: contains the documentation as required resources
Hands-on Assignment: contains the initial project that may be required to start
Hands-on Solution: contains the final application which is a solution for this hands- on
Each time a reference is made to some resources in the following pages, the user
must refer to the project folderHands-on Documentation .
1.2 Atmel Training Executable (.exe)
Depending where the executable has been installed, you will find the following architecture which is
composed by two main folders:
AN XXXX_Hands on- - : contains the initial project that may be required to start and a solution
Resources: contains required resources (datasheets, software, and tools…)
Unless a specific location is specified, each time a reference is made to some
resources in the following pages, the user must refer to this Resources folder.
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 445 of
2. Introduction
This hands-on will focus on the development of a simple Touch application that uses a Button sensor from the
Atmel QT1 Xplained Pro Self Capacitance extension board to modify the brightness of a LED.
The LED brightness is controlled using a PWM signal that is generated by one of the Atmel SAM D21
Timer/Counters for Control (TCC) peripherals.
The SAM D21 embeds three different 24 bit Timer/Counters for Control peripherals which provide extended -
functions compared to the standard Timer/Counters (TC):
Up to four compare channels with optional complementary outputs
Advanced waveform signal generation with dead time management
Deterministic fault protection, fast decay, and configurable dead time between complementary -
outputs
Dithering that increase resolution with up to five bits and reduce quantization error
The hands on will be divided in the following assignments:-
Create a new Touch project based on BUTTON 1 Touch sensor using QTouch lder from Project Bui
Atmel QTouch Composer:
Use QTouch Analyzer to provide graphical representation and demonstration of real time touch
data the . This will allow testing newly- . created Touch project
Implement a PWM signal using the TCC0 to control the LED8 brightnessperipheral
Atmel Software Framework TCC Quick Start Guide will be used to implement it (ASF)
easily
A Waveform Output pin (WO6) from the SAM D21 MCU will be used to output the PWM
signal directly to the LED8
Modify of the LED brightness in relation to the Touch Delta value BUTTON 1 by updating the PWM
duty cycle
Atmel QTouch library API will be used to get the delta value of BUTTON 1 sensor
BUTTON 1
LED8
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 446 of
3. Assignment 1: Create a Touch project using QTouch Project Builder
3.1 Project Creation
Create a new QTouch Project.
Open Atmel Studio 6.2
Click on the “QT” icon to open the QTouch Start Page :
QTouch StartPage is also accessible through the Tools menu:
Select “New QTouch UserBoard Project…”
Ensure “GCC QTouch Executable Project” is selected (default)*
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 447 of
Fill- in New Project fields according to following use cases:
Atmel Training Executable Case
Name: Hands On Assignment-
Location: “AN- - \ 9232_SAMD21 XPRO_QTouch_TCC assignments”
(relative path in the installation folder)ATMEL_TRAINING
Solution name: - Hands On Assignment
Click OK
Atmel Extension Case (downloaded from Atmel Gallery or Studio Extension Manager)
Name: Hands On Assignment-
Location: existing on Documentation Hands- solution path
Solution name: - Hands On Documentation
Click OK
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 448 of
The QTouch Project Builder wizard will guide through the steps involved in creating a QTouch projectnow .
Click “Next” in the Getting Started page (if shown):
The Kit design Page provides option to add, delete move QTouch Sensors such as button, wheel and an or
slider. also It provides options to setup physical and firmware properties of the board and sensors.
Add a button in the page by clicking on the “Button” icon, click “Add” and “NextKit Design
1
2
3
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 449 of
The technology Technology Selection Guide recommends which acquisition should be used based on the
number of sensors selected in Kit Design page and answers the below questionnairepreviously from .
We will consider for this hands on that our application hardware design exposed to moisture - is NOT
or water droplets or any specific sources of radiated noises
So, select “ ” as the answer to Question 1 . You will see that the proposed technology will No and 2
become QTouch ( i.e. Self Capacitance Technology):
For more information about designing the touch sensor, refer to Buttons, Sliders and
Wheels Touch Sensor Design Guide available at
www.atmel.com/images/doc10752.pdf.
Click “Next” in the Guide for Selecting Touch Technology page
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 10 44 of
Device Selection Page provides the option to view the number of QTouch sensors such as Button, Wheel and
Slider that was selected in the Kit Design Page.
Touch sensors can be based on two sub-technologies, QTouch/Self Capacitance and QMatrix/Mutual
Capacitance.
We can verify that has been correctly selected following our previous QTouch/ Self Capacitance
choice in the Guide for Selecting Touch Technology page
The device list displays device details such as Device Name, Variant, Application/Boot Memory, Data
Memory, EEPROM and supported technology. Data listing will vary based on device family, number of
selected sensors and technology as only devices supporting all choices made will be shown. Additionally user
has the option to search for a particular device.
Type “SAMD21” in the searc box to make a first filteringh
Select ATSAMD21J18A in the page and click “Next”. This is the device on the SAM Select Device
D21 Xplained Pro kit.
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 11 44 of
Self capacitance method uses a single sense electrode, denoted by a Y line.
Self capacitance touch button sensor is formed using a single Y line channel, while a touch rotor or slider
sensor can be formed using three Y line channels.
The Y-line numbering in the QT1 Xplained Pro User Guide does not correspond to
the Y-line numbering in the SAM D21 PTC module as the QT1 Xplained Pro is a
generic touch board (not dedicated to the SAM D21).
Flip the SAM D21 Xplained Pro and QT1 Xplained Pro boards and determine which SAM D21 I/O
pins that are connected to BUTTON 1
Look at next page to determine the right Y-line from QT1 Xplained PRO extension
board.
QT1
X plained PRO
SAM D21
Xplained PRO
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 12 44 of
Y- line for BUTTON 1 can be retrieved from the Atmel QT1 Xplained Pro User Guide
( http://www.atmel.com/Images/Atmel- - - - -42193 QT1 Xplained Pro_User Guide.pdf):
Table 3- 1. QT1 Xplained Pro SC Extension Header 1
Pin on EXT Function Description
1 ID Communication line to ID chip.
2 GND Ground
3 Y-Y_1 line 1 for Slider
4 Y-Y_2 line 2 for Slider
5 Y-Y_3 line 3 for Slider
6 Y-Y_4 line 4 for Wheel
7 LED_0 Slider, LED 0 (Yellow)
8 LED_1 Slider, LED 1 (Yellow)
9 Y-Y_5 line 5 for Wheel
10 Y-Y_6 line 6 for Wheel
11 Connected Not
12 Not Connected
13 Not Connected
14 Not Connected
15 LED_2 Slider, LED 2 (Yellow)
16 Y-Y_7 line 7 for Button 2
17 LED_3 Slider, LED 3 (Yellow)
18 Y-Y_8 line 8 for Button 1
19 Ground GND
20 VCC Target supply voltage
AN- -9232 Single slope PWM Implementation using SAM D21 TCC in a Touch-based Application: 42327 2014A 07/
Page 13 44 of
Use the page from QTouch Project Builder to select the Assign X-Y Line and Gain to the Channel
correct Y Line:
Y Line QT1 Xplained PRO
Y Line
SAM D21 Xplained PRO
Y Line – I/O
Y- – PA07 line Y_8 Y[5]


Product specificaties

Merk: Microchip
Categorie: Niet gecategoriseerd
Model: ATSAMD21J15

Heb je hulp nodig?

Als je hulp nodig hebt met Microchip ATSAMD21J15 stel dan hieronder een vraag en andere gebruikers zullen je antwoorden




Handleiding Niet gecategoriseerd Microchip

Handleiding Niet gecategoriseerd

Nieuwste handleidingen voor Niet gecategoriseerd