User manual
Atmel SAM D21 Xplained Pro [USER GUIDE]
42220A-MCU-02/2014
13
4.3 Embedded Debugger Implementation
SAM D21 Xplained Pro contains an Embedded Debugger (EDBG) that can be used to program and debug the
ATSAMD21J18A using Serial Wire Debug (SWD). The Embedded Debugger also include a Virtual Com port
interface over UART, an Atmel Data Gateway Interface over SPI and TWI and it monitors four of the SAM D21
GPIOs. Atmel Studio can be used as a front end for the Embedded Debugger.
4.3.1 Serial Wire Debug
The Serial Wire Debug (SWD) use two pins to communicate with the target. For further information on how to
use the programming and debugging capabilities of the EDBG, see “Embedded Debugger” on page 6.
Table 4-9. SWD Connections
Pin on SAM D21 Function
PA30 SWD clock
PA31 SWD data
4.3.2 Virtual COM Port
The Embedded Debugger acts as a Virtual Com Port gateway by using one of the ATSAMD21J18A UARTs.
For further information on how to use the Virtual COM port see “Embedded Debugger” on page 6.
Table 4-10. Virtual COM Port Connections
Pin on SAM D21 Function
PA22 SERCOM3 PAD[0] UART TXD (SAM D21 TX line)
PA23 SERCOM3 PAD[1] UART RXD (SAM D21 RX line)
4.3.3 Atmel Data Gateway Interface
The Embedded Debugger features an Atmel Data Gateway Interface (DGI) by using either a SPI or I²C port.
The DGI can be used to send a variety of data from the SAM D21 to the host PC. For further information on
how to use the DGI interface see “Embedded Debugger” on page 6.
Table 4-11. DGI Interface Connections when using SPI
Pin on SAM D21 Function
PB31 SERCOM5 PAD[1] SPI SS (Slave select) (SAM D21 is Master)
PB16 SERCOM5 PAD[0] SPI MISO (Master In, Slave Out)
PB22 SERCOM5 PAD[2] SPI MOSI (Master Out, Slave in)
PB23 SERCOM5 PAD[3] SPI SCK (Clock Out)
Table 4-12. DGI Interface Connections when using I²C
Pin on SAM D21 Function
PA08 SERCOM2 PAD[0] SDA (Data line)
PA09 SERCOM2 PAD[1] SCL (Clock line)
Four GPIO lines are connected to the Embedded Debugger. The EDBG can monitor these lines and time
stamp pin value changes. This makes it possible to accurately time stamp events in the SAM D21 application
code. For further information on how to configure and use the GPIO monitoring features see “Embedded
Debugger” on page 6.
Table 4-13. GPIO Lines Connected to the EDBG
Pin on SAM D21 Function
PA27 GPIO0
PA28 GPIO1
PA20 GPIO2
PA21 GPIO3