View detail for Atmel AT6491: Getting Started with SAM C21

APPLICATION NOTE
AT6491: Getting Started with SAM C21
SMART ARM Based Microcontroller
Description
This application note aims at getting started with the Atmel® SAM C21 ARM®
Cortex®-M0+ based microcontroller.
Features
 Getting started with Atmel® SAM C21 microcontrollers and tools
 Atmel SAM C21 Xplained Pro and Atmel 6.2 getting started
This application note contains a list of all necessary components and tools
required to start the work and point where to look for additional information.
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
Tabl e of Cont ent s
1
Device Datasheet ........................................................................................................................ 3
2
SAM C21 Xplained Pro Kit ......................................................................................................... 3
3
Tools
3.1
3.2
3.3
2
.................................................................................................................................... 4
Atmel Studio ......................................................................................................................................................... 4
IAR Embedded Workbench for ARM .................................................................................................................... 4
3.2.1 SAM C21 Xplained Pro Embedded Debugger Software (Segger J-Link) ................................................ 5
Atmel Software Framework (ASF) ........................................................................................................................ 5
4
Atmel Studio Users Getting Started ......................................................................................... 5
5
What’s Next ................................................................................................................................. 7
6
Revision History ......................................................................................................................... 8
AT6491:
Getting Started with SAM C21 [APPLICATION NOTE]
2
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
1
Device Datasheet
Web page: SAM C series
Document/file: Atmel SAM C21 Datasheet (summary, complete) (.pdf)
Select the required device (e.g. ATSAMC21J18A) and get the latest datasheet (.pdf file).


2
Complete version (includes extensive description for all peripherals and electrical characteristics)
Summary version
SAM C21 Xplained Pro Kit
Figure 2-1.
SAM D21 Xplained Pro Kit
Web page: SAM C21 Xplained Pro
Get kit: Atmel Store
Document/file:

SAM C21 Xplained Pro User Guide application note (.pdf)
Key features:





SAMC21J18A microcontroller
One mechanical reset button
One mechanical programmable button
One QTouch® button
One yellow user LED
AT6491: Getting Started with SAM C21 [APPLICATION NOTE]
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
3 3



















3
Two selectable target voltages
– 3.3V
– 5V
32.768kHz crystal oscillator
16MHz crystal footprint (not mounted)
Three Xplained Pro extension headers
CAN transceiver
LIN transceiver
– Wake-up button
– Master node pull-up enable
– Alternate LIN power jumper
DAC output connector
Analog voltage reference connector with filtered power supply
– SDADC VREF
– ADC/DAC VREF
Powered by USB or an external power supply
Supported with application examples in Atmel Software Framework (ASF)
Embedded Debugger (EDBG)
Auto ID for board identification in Atmel Studio 6.2
One yellow status LED
One green board power LED
Symbolic debug for complex data types including scope information
Programming
Data Gateway Interface. USART, I2C, four GPIOs
Virtual COM port (CDC)
The SAM C21 Xplained Pro User Guide application note covers how to power the kit, the detailed
information of the on-board components, extension interface and the hardware guide
Tools
Atmel Studio 6.2, which uses GCC compiler, is the preferred IDE to get started with SAM C21. Atmel Software
Framework supports the IAR™ compiler and the ASF standalone package can be used to get example
projects for SAM C21 in the IAR IDE.
3.1
Atmel Studio
Web page: Atmel Studio
Document:

Atmel Studio 6-2 sp2 Installer - Full (.exe)
Atmel Studio 6.2 SP2 is the preferred IDE for developing and debugging firmware for the SAM C21
microcontroller.
3.2
IAR Embedded Workbench for ARM
Web page: IAR Embedded Workbench® for ARM®
Document: IAR installer for ARM
4
AT6491:
Getting Started with SAM C21 [APPLICATION NOTE]
4
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
3.2.1
SAM C21 Xplained Pro Embedded Debugger Software (Segger J-Link)
Web page: Segger J-Link
Document/file: J-Link software
This software is required to program or debug the SAM C21 Xplained Pro if using Segger J-Link.
3.3
Atmel Software Framework (ASF)
Web page: http://asf.atmel.com
Document:




ASF update for Atmel Studio (.vsix)
ASF: standalone package for GCC makefile and IAR users
ASF: Getting started (.pdf)
ASF: Reference Manual (.pdf)
ASF online documentation for available API and examples can be found at Atmel Software Framework
Documentation.
4
Atmel Studio Users Getting Started
Prerequisites:



Atmel Studio 6.2 SP2 or above installed.
Latest ASF version (with SAM C21 support) or above installed.
SAM C21 Xplained Pro board connected to Atmel Studio 6.2 through the embedded debugger USB
connector. The kit will be powered by the USB port.
Work flow:




Launch Atmel Studio 6.2.
Connect the SAM C21 Xplained Pro to the PC using a USB cable.
To open the ASF examples, click "New Example Project...".
Select one of the examples (e.g. "Quick start for SAM CAN driver – SAMC21 Xplained Pro", see Figure
4-1 New Example Project for SAM C21), press OK and accept the license agreement. The project will be
created and opened.
AT6491: Getting Started with SAM C21 [APPLICATION NOTE]
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
5 5
Figure 4-1.


6
New Example Project for SAM C21
Open project properties (Project → Properties or shortcut Alt+F7)
In the Tool view, see Figure 4-2 Debugger and Interface for SAM C21, set "Selected
debugger/programmer" to XPRO-EDBG and "Interface" to SWD
AT6491:
Getting Started with SAM C21 [APPLICATION NOTE]
6
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
Figure 4-2.




5
Debugger and Interface for SAM C21
Build the project: Build → Build solution or shortcut F7
To load the code in the SAM C21 Xplained Pro and start debugging ("Debug → Start debugging and
break" or shortcut "Alt + F5")
The application is programmed and the debugger breaks in main
Run the code ("Debug → Continue" or shortcut "F5")
What’s Next
If you are interested in finding more documentation related to Atmel products and IDE, check the links below:






Atmel Studio videos: http://www.atmel.com/microsite/atmel_studio6/default.aspx
Atmel Studio help: Help → View Help (Ctrl+F1)
ASF Getting Started: http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx
ASF Reference Manual: http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx
ASF Reference Manual: http://asf.atmel.com
More technical documentation concerning various products: www.atmel.no/webdoc/
AT6491: Getting Started with SAM C21 [APPLICATION NOTE]
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
7 7
6
8
Revision History
Doc Rev.
Date
42466A
06/2015
Comments
Initial document release.
AT6491:
Getting Started with SAM C21 [APPLICATION NOTE]
8
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
Atmel Corporation
1600 Technology Drive, San Jose, CA 95110 USA
T: (+1)(408) 441.0311
F: (+1)(408) 436.4200
│
www.atmel.com
© 2015 Atmel Corporation. / Rev.:Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015.
Atmel®, Atmel logo and combinations thereof, Enabling Unlimited Possibilities®, and others are registered trademarks or trademarks of Atmel Corporation in U.S. and
other countries. ARM®, ARM Connected® logo, Cortex®, and others are the registered trademarks or trademarks 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, b y 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 T HE
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 (INCLUD ING, 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 representation s 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, auto motive applications. Atmel products are not intended,
authorized, or warranted for use as components in applications intended to support or sustain life.
SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in conne ction with any applications where
the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without an Atmel officer's specific written consent.
Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for t he operation of nuclear facilities and weapons systems. Atmel
products are not designed nor intended for use in military or aerospace applications or environments unless specifically desi gnated by Atmel as military-grade. Atmel products are not
designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive
-grade.
Atmel-42466A-Getting-Started-with-SAM-C21_ApplicationNote_062015
AT6491: Getting Started with SAM C21 [APPLICATION NOTE]
9 9