1.. _atmel_at86rf2xx_transceivers:
2
3Atmel AT86RF2XX Transceivers
4############################
5
6Overview
7********
8
9The Atmel AT86RF2xx is a high performance radio transceiver targeted for IEEE
10802.15.4, ZigBee, RF4CE, 6LoWPAN, and ISM applications.  The AT86RF2xx is a
11true SPI-to-antenna solution and can be operated by any external
12microcontroller.
13
14The current IEEE 802.15.4 AT86RF2xx Zephyr driver currently works with any
152.4 Ghz transceiver, except AT86RF230. The RF2xx driver allows use of
16:ref:`ieee802154_interface` and :ref:`thread_protocol_interface` network
17stacks.
18
19This is a generic shield focused not only on Atmel Development Boards Kits.
20There are compatible designations for `AT AVR-RZ600`_ and `AT REB233-XPRO`_.
21This means, any Atmel board with 10-pin Xplained or 20-pin Xplained Pro
22extension headers can be used. You can check
23`Atmel Xplained Pro Hardware Development Kit User Guide`_ for more information.
24Besides that, Arduino and MikroBus standard headers are available to complement
25the shield module configurations.  For any other project that doesn't fit on
26the current available variations an overlay can be created.  However, the
27overlay is the last resource and is recommended use standard header always
28possible.
29
30RZ600 Module
31============
32
33The RZ600 Development Kit needs Atmel Xplained or Xplained-Pro header
34connector.  The modules from this kit are available without any transceiver
35advanced features.  For Xplained headers the `atmel_rf2xx_xplained`_ must be
36selected.  For Xplained-Pro header the `atmel_rf2xx_legacy`_ must be enabled.
37
38.. image:: ATAVRRZ600.jpg
39   :align: center
40   :alt: AVR-RZ600
41
42Pins Assignment of the RZ600 Module
43===================================
44
45+---------+--------+-------------------------------------+
46|   Pin   |  Name  |           Function                  |
47+=========+========+=====================================+
48|    1    |  RST   | GPIO - Reset                        |
49+---------+--------+-------------------------------------+
50|    2    |  MISC  | DNU - Do Not Use                    |
51+---------+--------+-------------------------------------+
52|    3    |  IRQ   | GPIO - Interrupt                    |
53+---------+--------+-------------------------------------+
54|    4    | SLP_TR | GPIO - Multi purpose control signal |
55+---------+--------+-------------------------------------+
56|    5    |   CS   | SPI Chip Select                     |
57+---------+--------+-------------------------------------+
58|    6    |  MOSI  | SPI Master Out / Slave In           |
59+---------+--------+-------------------------------------+
60|    7    |  MISO  | SPI Master In / Slave Out           |
61+---------+--------+-------------------------------------+
62|    8    |  SCLK  | SPI Clock                           |
63+---------+--------+-------------------------------------+
64|    9    |  GND   |                                     |
65+---------+--------+-------------------------------------+
66|   10    |  VDD   |  POWER +3.3V                        |
67+---------+--------+-------------------------------------+
68
69REB233-XPRO Module
70==================
71
72The REB233-XPRO development kit uses Atmel Xplained Pro header.  It is enabled
73selecting `atmel_rf2xx_xpro`_ option.
74
75.. image:: atreb233-xpro-top.jpg
76   :align: center
77   :alt: REB233-XPRO Top
78
79Pins Assignment of the REB233-XPRO Module
80=========================================
81
82+---------+--------+-------------------------------------+
83|   Pin   |  Name  |           Function                  |
84+=========+========+=====================================+
85|    1    |   ID   | DNU - Do Not Use                    |
86+---------+--------+-------------------------------------+
87|    2    |  GND   |                                     |
88+---------+--------+-------------------------------------+
89|    3    |  DIG1  | DNU - Do Not Use                    |
90+---------+--------+-------------------------------------+
91|    4    |  DIG3  | DNU - Do Not Use                    |
92+---------+--------+-------------------------------------+
93|    5    |  DIG2  | GPIO - RX Frame Time Stamping       |
94+---------+--------+-------------------------------------+
95|    6    |  CLKM  | DNU - Do Not Use                    |
96+---------+--------+-------------------------------------+
97|    7    |  RST   | GPIO - Reset                        |
98+---------+--------+-------------------------------------+
99|    8    |        |                                     |
100+---------+--------+-------------------------------------+
101|    9    |  IRQ   | GPIO - Interrupt                    |
102+---------+--------+-------------------------------------+
103|   10    | SLP_TR | GPIO - Multi purpose control signal |
104+---------+--------+-------------------------------------+
105|   11    |  SDA   | EEPROM - AT24MAC602                 |
106+---------+--------+-------------------------------------+
107|   12    |  SCL   | EEPROM - AT24MAC602                 |
108+---------+--------+-------------------------------------+
109|   13    |        |                                     |
110+---------+--------+-------------------------------------+
111|   14    |        |                                     |
112+---------+--------+-------------------------------------+
113|   15    |   CS   | SPI Chip Select                     |
114+---------+--------+-------------------------------------+
115|   16    |  MOSI  | SPI Master Out / Slave In           |
116+---------+--------+-------------------------------------+
117|   17    |  MISO  | SPI Master In / Slave Out           |
118+---------+--------+-------------------------------------+
119|   18    |  SCLK  | SPI Clock                           |
120+---------+--------+-------------------------------------+
121|   19    |  GND   |                                     |
122+---------+--------+-------------------------------------+
123|   20    |  VDD   |  POWER +3.3V                        |
124+---------+--------+-------------------------------------+
125
126.. note:: DIG2 is not current implemented on RF2xx driver.
127
128Arduino Shields
129===============
130
131Arduino Uno R3 header is available without advanced features.  It is enabled
132selecting `atmel_rf2xx_arduino`_ variant option.
133
134Pins Assignment of the Arduino Shield Modules
135=============================================
136
137+---------+--------+-------------------------------------+
138|   Pin   |  Name  |           Function                  |
139+=========+========+=====================================+
140|   D0    |        |                                     |
141+---------+--------+-------------------------------------+
142|   D1    |        |                                     |
143+---------+--------+-------------------------------------+
144|   D2    |  IRQ   | GPIO - Interrupt                    |
145+---------+--------+-------------------------------------+
146|   D3    |        |                                     |
147+---------+--------+-------------------------------------+
148|   D4    |        |                                     |
149+---------+--------+-------------------------------------+
150|   D5    |        |                                     |
151+---------+--------+-------------------------------------+
152|   D6    |        |                                     |
153+---------+--------+-------------------------------------+
154|   D7    |        |                                     |
155+---------+--------+-------------------------------------+
156|   D8    |  RST   | GPIO - Reset                        |
157+---------+--------+-------------------------------------+
158|   D9    | SLP_TR | GPIO - Multi purpose control signal |
159+---------+--------+-------------------------------------+
160|   D10   |   CS   | SPI Chip Select                     |
161+---------+--------+-------------------------------------+
162|   D11   |  MOSI  | SPI Master Out / Slave In           |
163+---------+--------+-------------------------------------+
164|   D12   |  MISO  | SPI Master In / Slave Out           |
165+---------+--------+-------------------------------------+
166|   D13   |  SCLK  | SPI Clock                           |
167+---------+--------+-------------------------------------+
168|   D14   |        |                                     |
169+---------+--------+-------------------------------------+
170|   D15   |        |                                     |
171+---------+--------+-------------------------------------+
172|         |  GND   |                                     |
173+---------+--------+-------------------------------------+
174|         |  VDD   |  POWER +3.3V                        |
175+---------+--------+-------------------------------------+
176|         |  VCC   |  POWER +5.0V                        |
177+---------+--------+-------------------------------------+
178
179MikroBus Shields
180================
181
182MikroBus header is available available without advanced features.  It is
183enabled selecting `atmel_rf2xx_mikrobus`_ variant option.
184
185Pins Assignment of the MikroBus Shield Modules
186==============================================
187
188+---------+--------+-------------------------------------+
189|   Pin   |  Name  |           Function                  |
190+=========+========+=====================================+
191|   AN    |  RST   | GPIO - Reset                        |
192+---------+--------+-------------------------------------+
193|   RST   |        |                                     |
194+---------+--------+-------------------------------------+
195|   CS    |   CS   | SPI Chip Select                     |
196+---------+--------+-------------------------------------+
197|   SCK   |  SCLK  | SPI Clock                           |
198+---------+--------+-------------------------------------+
199|  MISO   |  MISO  | SPI Master In / Slave Out           |
200+---------+--------+-------------------------------------+
201|  MOSI   |  MOSI  | SPI Master Out / Slave In           |
202+---------+--------+-------------------------------------+
203| VCC-3.3 |  VDD   |  POWER +3.3V                        |
204+---------+--------+-------------------------------------+
205|   GND   |  GND   |                                     |
206+---------+--------+-------------------------------------+
207|   GND   |  GND   |                                     |
208+---------+--------+-------------------------------------+
209| VCC-5.0 |  VCC   |  POWER +5.0V                        |
210+---------+--------+-------------------------------------+
211|   SDA   |        |                                     |
212+---------+--------+-------------------------------------+
213|   SCL   |        |                                     |
214+---------+--------+-------------------------------------+
215|   TX    |        |                                     |
216+---------+--------+-------------------------------------+
217|   RX    |        |                                     |
218+---------+--------+-------------------------------------+
219|   INT   |  IRQ   | GPIO - Interrupt                    |
220+---------+--------+-------------------------------------+
221|   PWM   | SLP_TR | GPIO - Multi purpose control signal |
222+---------+--------+-------------------------------------+
223
224Supported variations
225====================
226
227The below table suggests shield variation accordingly with end user
228application.  When a standard connector (arduino, mikrobus, xplained,
229xplained-pro) is available on board, user should select the matching shield
230configuration. When atmel_rf2xx shield is used with a board that doesn't
231feature a standard connector, a dedicated <board>.overlay file should be
232provided.  The remaining configurations should be used based on the board
233standard headers available.
234
235+-----------------------------+------------------------------+-----------+
236| Connector Standard          | Shield Designation           | Variation |
237+=============================+==============================+===========+
238| Without standard (overlay)  | `atmel_rf2xx`_               |     1     |
239+-----------------------------+------------------------------+-----------+
240| Atmel Xplained header       | `atmel_rf2xx_xplained`_      |     2     |
241+-----------------------------+------------------------------+-----------+
242| Atmel Xplained Pro header   | `atmel_rf2xx_xpro`_          |     3     |
243+-----------------------------+------------------------------+-----------+
244| Atmel Xplained Pro header   | `atmel_rf2xx_legacy`_        |     4     |
245+-----------------------------+------------------------------+-----------+
246| Arduino                     | `atmel_rf2xx_arduino`_       |     5     |
247+-----------------------------+------------------------------+-----------+
248| MikroBus                    | `atmel_rf2xx_mikrobus`_      |     6     |
249+-----------------------------+------------------------------+-----------+
250
251Requirements
252************
253
254This shield requires a board which provides a configuration that allows an
255SPI interface, an interrupt signal and two GPIO. (see :ref:`shields` for more
256details).
257
258.. note::
259	Boards that already have a network interface:  Check network
260	documentation to understand how properly configure both interfaces.
261	To keep simple, make sure IEEE 802.15.4 is the only interface enabled
262	at Networking -> Link Layer Options.  This will avoid problems running
263	Zephyr samples.
264
265Tested Boards
266=============
267
268+-----------------------------+------------------------------+-----------+
269| Board                       | Disabled Interface           | Variation |
270+=============================+==============================+===========+
271| ATMEL sam4s_xplained        |                              |     2     |
272+-----------------------------+------------------------------+-----------+
273| ATMEL sam4e_xpro            | Ethernet                     |   3 , 4   |
274+-----------------------------+------------------------------+-----------+
275| ATMEL sam_v71_xult          | Ethernet                     | 3 , 4 , 5 |
276+-----------------------------+------------------------------+-----------+
277
278Sample usage
279************
280
281You can try use IEEE 802.15.4 and/or OpenThread with the Zephyr Echo server
282and Echo client samples, which provide out-of-the-box configuration for
283both IEEE 802.15.4 and OpenThread.  To enable IEEE 802.15.4 support in the
284samples, build them with ``overlay-802154.conf`` overlay config file.  Same
285way, to enable OpenThread support, build them with ``overlay-ot.conf`` overlay
286config file. See :zephyr:code-sample:`sockets-echo-server` and
287:zephyr:code-sample:`sockets-echo-client` samples for details.
288
289Build and Programming
290*********************
291
292Set ``-DSHIELD=<shield designator>`` when you invoke ``west build``.
293
294.. zephyr-app-commands::
295   :zephyr-app: samples/net/sockets/echo_server
296   :host-os: unix
297   :board: sam4s_xplained
298   :gen-args: -DOVERLAY_CONFIG=overlay-802154.conf
299   :shield: atmel_rf2xx_xplained
300   :goals: build flash
301   :compact:
302
303.. zephyr-app-commands::
304   :zephyr-app: samples/net/sockets/echo_server
305   :host-os: unix
306   :board: [sam4e_xpro | sam_v71_xult]
307   :gen-args: -DOVERLAY_CONFIG=overlay-802154.conf
308   :shield: [atmel_rf2xx_xpro | atmel_rf2xx_legacy]
309   :goals: build flash
310   :compact:
311
312.. zephyr-app-commands::
313   :zephyr-app: samples/net/sockets/echo_server
314   :host-os: unix
315   :board: [sam_v71_xult | frdm_k64f | nucleo_f767zi]
316   :gen-args: -DOVERLAY_CONFIG=overlay-802154.conf
317   :shield: atmel_rf2xx_arduino
318   :goals: build flash
319   :compact:
320
321.. zephyr-app-commands::
322   :zephyr-app: samples/net/sockets/echo_server
323   :host-os: unix
324   :board: lpcxpresso55s69_ns
325   :gen-args: -DOVERLAY_CONFIG=overlay-802154.conf
326   :shield: atmel_rf2xx_microbus
327   :goals: build flash
328   :compact:
329
330References
331**********
332
333.. target-notes::
334
335.. _AT AVR-RZ600:
336   https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATAVRRZ600
337
338.. _AT REB233-XPRO:
339   https://www.microchip.com/DevelopmentTools/ProductDetails/PartNO/ATREB233-XPRO
340
341.. _Atmel Xplained Pro Hardware Development Kit User Guide:
342   http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42091-Atmel-Xplained-Pro-Hardware-Development-Kit_User%20Guide.pdf
343
344.. _atmel_rf2xx:
345   https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/atmel_rf2xx/atmel_rf2xx.overlay
346
347.. _atmel_rf2xx_xplained:
348   https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/atmel_rf2xx/atmel_rf2xx_xplained.overlay
349
350.. _atmel_rf2xx_xpro:
351   https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/atmel_rf2xx/atmel_rf2xx_xpro.overlay
352
353.. _atmel_rf2xx_legacy:
354   https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/atmel_rf2xx/atmel_rf2xx_legacy.overlay
355
356.. _atmel_rf2xx_arduino:
357   https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/atmel_rf2xx/atmel_rf2xx_arduino.overlay
358
359.. _atmel_rf2xx_mikrobus:
360   https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/shields/atmel_rf2xx/atmel_rf2xx_mikrobus.overlay
361