View detail for Atmel AT01778: Getting Started with SAM4L

APPLICATION NOTE
Atmel AT01778: Getting Started with SAM4L
Atmel SAM4L
Features
•
•
•
Getting started with SAM4L device and tools
SAM4L-EK and SAM4L Xplained Pro getting started
Atmel Studio 6.1 getting started
Description
This application note aims at helping the reader to get start with the Atmel® ARM®
Cortex®—M4 based SAM4L microcontroller.
42024B-SAM4L-05/2013
1.
Get SAM4L Datasheet
Web page: www.atmel.com/products/microcontrollers/arm/sam4l.aspx?tab=documents
Document: SAM4L Series Datasheet (complete, summary) (.pdf)
• Select the required device (i.e., ATSAM4Lx) or and get the latest datasheet (.pdf file). There are two versions:
•
complete version (includes all peripherals description and electrichal characteristic)
•
summary version
2.
Get SAM4L Evaluation Kits
2.1
Get SAM4L-EK
Web page:
http://www.atmel.com/tools/SAM4L-EK.aspx
Get the kit:
http://store.atmel.com/
Document/file:
• SAM4L-EK gerber files: schematics (.pdf), gerber, BOM, errata
• SAM4L-EK User Guide application note (.pdf)
• SAM4L schematic checklist application note (.pdf)
Key Features:
• SAM4LC4C Cortex-M4 device
• Board monitor with OLED color display, power measurement stage for ATSAM4LC4C power, joystick and five
LEDS
•
•
•
•
•
•
•
Segger J-Link OB Module (embedded debugger)
QTouch slider and button
Segment LCD (4x40)
USB host and device
Wireless 10-pin interface
SPI serial Flash (AT25DF641A)
Sensor Xplained support
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
2
•
•
•
•
•
Light sensor
Reset push button
Audio jack connector
User input push button
RS485 connector
SAM4L-EK comes with a preloaded firmware which demonstrates the low power and QTouch capability of the product.
The demo is available in Atmel Software Framework (ASF).
SAM4L-EK User Guide application note covers how to power the kit, the firmware demonstration workflow and the
board/schematics guide.
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
3
2.2
Get SAM4L Xplained Pro Kits
Web page:
http://www.atmel.com/tools/ATSAM4L-XPRO.aspx
Get the kit:
http://store.atmel.com/
Document/file:
• SAM4L Xplained Pro User Guide application note (.pdf)
Key Features:
•
•
•
•
•
•
•
•
•
•
•
•
•
SAM4LC4C microcontroller
One mechanical reset button
One mechanical user pushbutton (wake-up, bootloader entry or general purpose)
One QTouch button
One yellow user LED
USB interface, host and device function (shared physical interface)
32.768kHz crystal
12MHz crystal
4 Xplained Pro extension headers
One custom extension header for segment LCD displays
LDO/Buck regulator mode selection
LCD cluster power configuration option
Embedded Debugger
•
•
•
•
Auto-ID for board identification in Atmel Studio 6.1
One yellow status LED
One green board power LED
Symbolic debug of complex data types including scope information
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
4
•
•
•
Programming
Data Gateway Interface: USART, TWI, 4 GPIOs
Virtual COM port (CDC)
• USB powered
• Supported with application examples in Atmel Software Framework
SAM4L 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.
Please note that there is SAM4L8 Xplained Pro, which mounts SAM4LC8C chip. For the difference between two
devices, please refer to the SAM4L series datasheet for more detailes.
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
5
3.
Get the Tools
Atmel Studio 6.1 is the prefered IDE to get started with the SAM4L device and GCC compiler. IAR™ compiler is
supported as well.
3.1
Get Atmel Studio 6.1
Web page:
http://www.atmel.com/microsite/atmel_studio6/default.aspx
Document/file:
• Atmel Studio 6.1 installer (.exe), the latest version
Atmel Studio 6.1 is the IDE for developping and debugging the SAM4L microcontroller with GCC compiler.
3.2
3.3
Get IAR Embedded Workbench for ARM
Web page:
http://www.iar.com/en/Products/IAR-Embedded-Workbench/ARM/
Document/file:
IAR Embedded Workbench for ARM installer, the latest version
Web page:
http://www.atmel.com/tools/SAM4L-EK.aspx or http://www.atmel.com/tools/ATSAM4L-XPRO.aspx
Document/file:
IAR add-on installer for SAM4L
Get SAM4L-EK Embedded Debugger Software (SAM4L-EK only)
Web page:
http://www.segger.com/jlink-software.html
Document/file:
J-Link software
This software is required to use the SAM4L-EK embedded debugger Segger J-Link OB with IAR IDE.
3.4
Get Atmel Software Framework (ASF)
Web page:
http://www.atmel.com/tools/AVRSOFTWAREFRAMEWORK.aspx
Document/file:
• Atmel Software Framework, the latest version
ASF online documentation for available API and examples can be found at http://asf.atmel.com.
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
6
4.
Atmel Studio 6.1 Users Getting Started
4.1
Using SAM4L-EK
Requirements:
• Atmel Studio 6.1(the latest version) installed
• ASF (the latest version) installed
• SAM4L-EK board connected to Atmel Studio 6.1 through the embedded debugger USB connector (open the JLink DIS jumper). The kit will be powered by the USB
Get Started with Atmel Studio 6.1, ASF and SAM4L-EK:
•
•
•
•
•
Launch Atmel Studio 6.1
Connect the SAM4L-EK USB Embedded Debugger connector to the PC
To start ASF examples, File -> New -> Example Project
Select the “kit” view and select SAM4L-EK
Pick one of the examples (e.g., SAM4L Low Power and QTouch Demo), press OK and accept the license
agreement. Then the project will be created and opened.
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
7
• Right-click on the project, select Properties
• In Tool view, set selected debugger/programmer to J-Link and set the interface to “SWD”
• Build the project: Build->Build solution (shortcut: F7)
• To load the code in the SAM4L and debug, click on Debug->Start debugging and break (ALT+F5)
• The application is programmed and the debugger breaks in main.
To run the code, click on Debug->Continue (F5)
4.2
Using SAM4L Xplained Pro Kits
Requirements:
• Atmel Studio 6.1 (the latest version) installed
• ASF (the latest version) installed
• Close the jumpers on the board and select LDO power mode, please refer to SAM4L Xplained Pro User Guide
for the detailed jumper description
• SAM4L Xplained Pro connected to Atmel Studio 6.1 through the embedded debugger USB connector (DEBUG
USB port on the board). The kit will be powered by the USB
Get Started with Atmel Studio 6.1, ASF and SAM4L Xplained Pro:
• Launch Atmel Studio 6.1
• Connect the SAM4L Xplained Pro USB Embedded Debugger connector to the PC. Then the following page
shows.
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
8
• To start ASF examples, Click “New Example Project…”
• Select the “kit” view and select SAM4L Xplained Pro
• Pick one of the examples (e.g., Low Power Demo for SAM boards), press OK and accept the license
agreement. Then the project will be created and opened.
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
9
• Right-click on the project, select Properties
• In Tool view, set selected debugger/programmer to XPRO-EDBG.
• Build the project: Build->Build solution (shortcut: F7)
• To load the code in the SAM4L and debug, click on Debug->Start debugging and break (ALT+F5)
• The application is programmed and the debugger breaks in main.
To run the code, click on Debug->Continue (F5)
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
10
5.
What next
•
•
•
•
•
Atmel Studio videos:
www.atmel.com/atmelstudio
Atmel Studio Help:
Help->View Help (Ctrl+F1)
ASF Getting Started:
www.atmel.com/asf
ASF on-line documentation: http://asf.atmel.com
ASF Reference manual:
www.atmel.com/asf
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
11
Appendix A.
Revision history
Doc. rev.
Date
Comments
42024A
09/2012
Initial document release
42024B
05/2013
Updated the content of SAM4L-EK and added SAM4L Xplained Pro information
Renamed from AVR4036 to AT01178
®
Cortex™ updated to Cortex
Atmel AT01778: Getting Started with SAM4L
42024B-SAM4L-05/2013
12
Atmel Corporation
Atmel Asia Limited
Atmel Munich GmbH
Atmel Japan G.K.
1600 Technology Drive
Unit 01-5 & 16, 19F
Business Campus
16F Shin-Osaki Kangyo Building
San Jose, CA 95110
BEA Tower, Millennium City 5
Parkring 4
1-6-4 Osaki
USA
418 Kwun Tong Road
D-85748 Garching b. Munich
Shinagawa-ku, Tokyo 141-0032
Tel: (+1)(408) 441-0311
Kwun Tong, Kowloon
GERMANY
JAPAN
Fax: (+1)(408) 487-2600
HONG KONG
Tel: (+49) 89-31970-0
Tel: (+81)(3) 6417-0300
www.atmel.com
Tel: (+852) 2245-6100
Fax: (+49) 89-3194621
Fax: (+81)(3) 6417-0370
Fax: (+852) 2722-1369
© 2013 Atmel Corporation. All rights reserved. / Rev.: 42024B−SAM4L−05/2013
Atmel®, Atmel logo and combinations thereof, AVR®, Enabling Unlimited Possibilities®, QTouch®, and others are registered trademarks or trademarks of Atmel
Corporation or its subsidiaries. ARM®, Cortex® and others are 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, 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.