Electronic – Migrating from PIC32MX to ATSAM MCU – SWD interface doubt

armmicrocontroller

Currently I use PIC32MX MCUs in my projects, but my new projects are going to have ATSAME5 MCUs onboard. On the PIC32MX I use a 5-pin interface to program and debug using a PICkit4 tool. The signals that I always used with PIC32MX are VCC, GND, MCLR/VPP, DATA-IO/PGD and CLOCK/PGC. For new projects I am going to use ATSAME5 MCUs, and I plan to keep using a 5-pin interface, by using VCC, GND, RESETn, SWDIO and SWCLK. I want to confirm if these group of 5 signals are really enough to program and debug the ATSAM MCUs, because it will be my first project with an ARM core.

Best Answer

Yes you're right, since the SAM E5 family is ARM Cortex based, the 5 signals you mention are the one you need to program a target device in "Serial Wire" mode:

VCC, GND, RESETn, SWCLK, SWDIO

That's what I have on several designs and it works well (AT SAM and STM32).

But if you want extended debugging features you need to add some more signals. The many documentations about ARM Cortex programming interfaces might help you:

Extract from the ARM Keil documentation:

Signal  | Connects to...
------------------------
SWDIO   | Data I/O pin. Use 100K Ohm pull-up resistor to VCC.
SWO     | **Optional** trace output pin.
SWCLK   | Clock pin. Use 100K Ohm pull-down resistor to GND.
VCC     | Positive Supply Voltage — Power supply for JTAG interface drivers.
GND     | Digital ground.
nRESET  | nRESET pin — Connect this pin to the (active low) reset input of the target CPU. Use 100K Ohm pull-up resistor to VCC. This is an open-collector/open-drain output.