1.. zephyr:board:: samc21n_xpro
2
3Overview
4********
5
6The SAM C21N Xplained Pro evaluation kit is ideal for evaluation and
7prototyping with the SAM C21N Cortex®-M0+ processor-based
8microcontrollers. The kit includes Atmel’s Embedded Debugger (EDBG),
9which provides a full debug interface without the need for additional
10hardware.
11
12Hardware
13********
14
15- SAMC21N18A ARM Cortex-M0+ processor at 48 MHz
16- 32.768 kHz crystal oscillator
17- 256 KiB flash memory, 32 KiB of RAM, 8KB RRW flash
18- One yellow user LED
19- One mechanical user push button
20- One reset button
21- One QTouch® button
22- On-board USB based EDBG unit with serial console
23- Two CAN transceivers
24
25Supported Features
26==================
27
28.. zephyr:board-supported-hw::
29
30Pin Mapping
31===========
32
33The SAM C21N Xplained Pro evaluation kit has 4 GPIO controllers. These
34controllers are responsible for pin muxing, input/output, pull-up, etc.
35
36For more details please refer to `SAM C21 Family Datasheet`_ and the `SAM C21N
37Xplained Pro Schematic`_.
38
39Default Zephyr Peripheral Mapping:
40----------------------------------
41- ADC0             : PB09
42- ADC1             : PA08
43- CAN0 TX          : PA24
44- CAN0 RX          : PA25
45- CAN1 TX          : PB14
46- CAN1 RX          : PB15
47- SERCOM0 USART TX : PB24
48- SERCOM0 USART RX : PB25
49- SERCOM1 I2C SDA  : PA16
50- SERCOM1 I2C SCL  : PA17
51- SERCOM2 USART TX : PA12
52- SERCOM2 USART RX : PA13
53- SERCOM4 USART TX : PB10
54- SERCOM4 USART RX : PB11
55- SERCOM5 SPI MISO : PB00
56- SERCOM5 SPI MOSI : PB02
57- SERCOM5 SPI SCK  : PB01
58- GPIO/PWM LED0    : PC05
59
60System Clock
61============
62
63The SAMC21 MCU is configured to use the 32.768 kHz internal oscillator
64with the on-chip internal oscillator generating the 48 MHz system clock.
65
66Serial Port
67===========
68
69The SAMC21 MCU has eight SERCOM based USARTs with three configured as USARTs in
70this BSP. SERCOM4 is the default Zephyr console.
71
72- SERCOM0 9600 8n1
73- SERCOM2 115200 8n1
74- SERCOM4 115200 8n1 connected to the onboard Atmel Embedded Debugger (EDBG)
75
76PWM
77===
78
79The SAMC21 MCU has 3 TCC based PWM units with up to 4 outputs each and a period
80of 24 bits or 16 bits.  If :code:`CONFIG_PWM_SAM0_TCC` is enabled then LED0 is
81driven by TCC2 instead of by GPIO.
82
83Programming and Debugging
84*************************
85
86The SAM C21N Xplained Pro comes with a Atmel Embedded Debugger (EDBG). This
87provides a debug interface to the SAMC21 chip and is supported by
88OpenOCD.
89
90Flashing
91========
92
93#. Build the Zephyr kernel and the ``hello_world`` sample application:
94
95   .. zephyr-app-commands::
96      :zephyr-app: samples/hello_world
97      :board: samc21n_xpro
98      :goals: build
99      :compact:
100
101#. Connect the SAM C21N Xplained Pro to your host computer using the USB debug
102   port.
103
104#. Run your favorite terminal program to listen for output. Under Linux the
105   terminal should be :code:`/dev/ttyACM0`. For example:
106
107   .. code-block:: console
108
109      $ minicom -D /dev/ttyACM0 -o
110
111   The -o option tells minicom not to send the modem initialization
112   string. Connection should be configured as follows:
113
114   - Speed: 115200
115   - Data: 8 bits
116   - Parity: None
117   - Stop bits: 1
118
119#. To flash an image:
120
121   .. zephyr-app-commands::
122      :zephyr-app: samples/hello_world
123      :board: samc21n_xpro
124      :goals: flash
125      :compact:
126
127   You should see "Hello World! samc21n_xpro" in your terminal.
128
129References
130**********
131
132.. target-notes::
133
134.. _Microchip website:
135    https://www.microchip.com/en-us/development-tool/ATSAMC21N-XPRO
136
137.. _SAM C21 Family Datasheet:
138    https://ww1.microchip.com/downloads/aemDocuments/documents/MCU32/ProductDocuments/DataSheets/SAM-C20-C21-Family-Data-Sheet-DS60001479J.pdf
139
140.. _SAM C21N Xplained Pro Schematic:
141    https://ww1.microchip.com/downloads/en/DeviceDoc/ATSAMC21N_Xplained_Pro_Design_Files.zip
142