microcontrolleratmeljtagswd

SWD interface SAM device


im trying to design custom board for microcontroller

im trying with SAM series (SAMD21G18) from microchip

they recommended : enter image description here

https://www.microchip.com/webdoc/GUID-DDB0017E-84E3-4E77-AAE9-7AC4290E5E8B/index.html?GUID-6A4D7A9A-C350-4FDF-BECA-198D23A19E44

i can see in the datasheet there is (PA30 and PA31) as (SWCLK and SWDIO)

so im buying ATMEL-ICE and these are connection that i know about

  1. VCC -> target VDDIN
  2. GND -> GND
  3. SWDIO -> PA31
  4. SWDCLK -> PA30
  5. nReset -> target reset

how about the other pins (key) and (SWO) ?


and about the interface .. is this from top of connector ? so i should put the exact pad or holes in the pcb ? or this is from bottom of the connector and i have to flip them ?


another question if im planning to make the board and to flash the boatloader into them .. whats the best way to put this in the circuit

should i just use the SWD interface as "Blind Via" and then stick the programmer pins into the pcb ?


Solution

  • (KEY) is a physical key to ensure that the Cortex Debug connector is attached in the correct orientation. The hole corresponding to (KEY) on the connector is typically filled and the pin corresponding to (KEY) on the header is typically cut. So (KEY) is effectively a no connect from the board's point of view.

    The SWO pin enables advanced debugging features (if they are supported by the microcontroller and debugging tool). The advanced debugging features enabled by SWO are called Serial Wire Viewer (SWV) and Instrumentation Trace Macrocell (ITM). These features are not necessary but can make it easier to track down difficult software bugs.

    nRESET may not be absolutely necessary but it will allow your debug tool to automatically reset the board after downloading the firmware. Without nRESET connected you may need to manually reset the board every time you download new firmware to debug.

    That pin layout is looking down at the header from above. See the picture of the Cortex Debug header on this page. Notice that pin 1 is marked on the board and the (KEY) pin is cut.

    The best way is to purchase the "10-pin Cortex Debug Connector" and solder that to your board.