1.. _sam4l_ek:
2
3SAM4L-EK
4########
5
6Overview
7********
8
9The SAM4L series embeds picoPower technology for ultra-low power consumption.
10Combined power control techniques are used to bring active current consumption
11down to 90μA/MHz.  The device allows a wide range of configurations giving the
12user the ability to balance between the lowest possible power consumption and
13the feature set selected for the application.  The WAIT and RETENTION modes
14provide full logic and RAM retention, associated with fast wake-up capability
15(<1.5μs) and a very low consumption of, respectively, 3 μA and 1.5 μA.  In
16addition, WAIT mode supports SleepWalking features.  In BACKUP mode, CPU,
17peripherals and RAM are powered off consuming less than 0.9μA with external
18interrupt wake-up support.
19
20The SAM4L-EK is a full featured design to develop for Atmel SAM4L SoC series.
21The kit is equipped with a rich set of peripherals that make the ATSAM4L-EK a
22perfect evaluation platform.  Download the `SAM4L-EK Online User Guide`_ for
23more details.
24
25.. image:: img/atmel-sam4l-ek-callouts.jpg
26     :align: center
27     :alt: SAM4L-EK
28
29Hardware
30********
31
32- ATSAM4LC4C ARM Cortex-M4 Processor
33- 12 MHz crystal oscillator
34- 32.768 kHz crystal oscillator
35- 1 Micro-AB USB OTG host/device
36- 1 AT86RF2xx IEEE 802.15.4 transceiver connector
37- 1 RS-485 full duplex interface
38- 1 Sensor Xplained board connector
39- 1 Audio Jack connector 3.5mm
40- 1 Dedicated Board Monitor MCU
41
42  - Power measurement (VDDIN, VDDIO, VDDANA)
43  - 1 OLED Display (128x64)
44  - 5 LEDs
45  - 1 Joystick
46  - 1 USART
47  - 1 TWI
48- 1 40x4 LCD Segment Display
49- 1 user touch button and One user pushbutton
50- 1 user LED
51- 1 QTouch Slider
52- 1 QTouch Button
53- 1 TEMT6000 Light Sensor
54- 1 AT25DF641A Serial NOR Flash
55
56Supported Features
57==================
58
59The sam4l_ek board configuration supports the following hardware features:
60
61+-----------+------------+-------------------------------------+
62| Interface | Controller | Driver/Component                    |
63+===========+============+=====================================+
64| GPIO      | on-chip    | gpio                                |
65+-----------+------------+-------------------------------------+
66| HWINFO    | on-chip    | Unique 120 bit serial number        |
67+-----------+------------+-------------------------------------+
68| MPU       | on-chip    | arch/arm                            |
69+-----------+------------+-------------------------------------+
70| NVIC      | on-chip    | arch/arm                            |
71+-----------+------------+-------------------------------------+
72| SPI       | on-chip    | spi                                 |
73+-----------+------------+-------------------------------------+
74| SYSTICK   | on-chip    | systick                             |
75+-----------+------------+-------------------------------------+
76| TRNG      | on-chip    | 32-bit True Random Number Generator |
77+-----------+------------+-------------------------------------+
78| TWIM      | on-chip    | i2c master port-interrupt           |
79+-----------+------------+-------------------------------------+
80| USART     | on-chip    | serial port                         |
81+-----------+------------+-------------------------------------+
82
83Other hardware features are not currently supported by Zephyr.
84
85The default configuration can be found in the Kconfig
86:zephyr_file:`boards/arm/sam4l_ek/sam4l_ek_defconfig`.
87
88Connections and IOs
89===================
90
91The `SAM4L-EK Design Documentation`_ has detailed information about board
92connections.  Download the `SAM4L-EK Design Documentation`_ for more details.
93
94System Clock
95============
96
97The SAM4L MCU is configured to use the 12 MHz internal oscillator on the board
98with the on-chip PLL to generate an 48 MHz system clock.
99
100Serial Port
101===========
102
103The ATSAM4LC4C MCU has 4 USARTs.  One of the USARTs (USART2) is connected on
104the embedded debug unit and can works as a console.  The USART0 is shared
105between all others headers and RS-485 port.
106
107Programming and Debugging
108*************************
109
110The SAM4L-EK board have a Segger Embedded Debugger Unit
111`J-Link OB <https://www.segger.com/jlink-ob.html>`_.  This provides a debug
112interface to the SAM4LC4C chip. You can use Ozone or JLink to communicate with
113the SAM4LC4C.
114
115Flashing
116========
117
118#. Download JLink from the Segger `JLink Downloads Page`_.  Go to the section
119   "J-Link Software and Documentation Pack" and install the "J-Link Software
120   and Documentation pack for Linux".  The application JLinkExe needs to be
121   accessible from your path.
122
123#. Run your favorite terminal program to listen for output.  Under Linux the
124   terminal should be :code:`/dev/ttyACM0`. For example:
125
126   .. code-block:: console
127
128      $ minicom -D /dev/ttyACM0 -o
129
130   The -o option tells minicom not to send the modem initialization string.
131   Connection should be configured as follows:
132
133   - Speed: 115200
134   - Data: 8 bits
135   - Parity: None
136   - Stop bits: 1
137
138#. Connect the SAM4L-EK board to your host computer using the USB debug port.
139   Then build and flash the :ref:`hello_world` application.
140
141   .. zephyr-app-commands::
142      :zephyr-app: samples/hello_world
143      :board: sam4l_ek
144      :goals: build flash
145
146   You should see "Hello World! sam4l_ek" in your terminal.
147
148Debugging
149=========
150
151You can debug an application in the usual way.  Here is an example for the
152:ref:`hello_world` application.
153
154.. zephyr-app-commands::
155   :zephyr-app: samples/hello_world
156   :board: sam4l_ek
157   :maybe-skip-config:
158   :goals: debug
159
160References
161**********
162
163.. target-notes::
164
165.. _SAM4L-EK Online User Guide:
166    http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42026-ATSAM4L-EK-User-Guide_ApplicationNote_AVR32850.pdf
167
168.. _SAM4L-EK Design Documentation:
169    http://ww1.microchip.com/downloads/en/DeviceDoc/doc42027_SAM4L-EK_Design_Documentation.PDF
170
171.. _JLink Downloads Page:
172    https://www.segger.com/downloads/jlink
173