User Tools

Site Tools


documentation:electronics:samdisp

SAMD ISP

Based on the ATASAMD11C14, the SAMD ISP is a small programmer board that allows all the microntrollers from the SAMD family to be programmed via Serial Debug Interface, or SWD. SWD is a 2 pin alternative to the JTAG interface, using the same protocol under the hood. SWD is specific to ARM microcontrollers that implement a standard wire bi-directional communication.

In the schematic below, only few additional components are present, apart from the ATASAMD11C14. Notably a 100mA voltage regulator (LM3480IM3-3.3), used to step down from the 5V given by the USB connector, a 1uF capacitor to filter the power noise, and 2 5×2 pin SMD headers.

gitlab.hsrw.eu_ferdinand.meier_fablab_-_wikis_uploads_b0f3e920fd78281bdea7e61000aa682c_schematic.jpg


The board layout uses the ground layer to simplify the connection of the GND signal, and an USB mini connector, to avoid the eventual problems given by the milled USB traces.

gitlab.hsrw.eu_ferdinand.meier_fablab_-_wikis_uploads_4a34e5aeab8afe17e62cb0a6242d6e2c_board_layout.jpg

Programming

Prerequisites

To tryout to program your SAMD ISP, or to setup the environment to work with the SAMD microntrollers, you need to have/install the following software/hardware devices.

Hardware
  • ATMEL-ICE. ATMEL-ICE is the official Microchip programmer, able to upload the code in a wide range of AVR/SAM microcontrollers. Being expensive in both the board and the connectors, it is recommended to be used only if you do not have other programming alternatives.
  • SAMD ISP. SAMD ISP is a little programmer that can program other SAMD microcontroller. It is recommended to use the SAMD ISP whenever possible instead of the ATMEL_ICE.
  • USB Mini/Micro cable(s) A USB micro cable is needed to power/interface the ATMEL-ICE and a USB mini cable is needed for SAMD ISP.
  • 5X2 Ribbon cable and connectors 0.1" pitch. The ribbon cable is useful as programming cable, both from ATMEL-ICE (using the adapter board), or from the SAMD ISP.
  • Converter Board Small board-hack that allows the ATMEL-ICE to connect with higher picther SMD headers.

An important note is, it is always needed to power the devices separately during programming. As power source the USB port is recommended.

Software
  • EDBG. EDBG is a command line tool, used to program the SAMD microcontrollers from command line console in Windows/MacOS/Linux. Is convienent to install EDBG into the system PATH.
  • Atmel Studio 7. Full programming suite from Microchip. To install the drivers of the ATMEL-ICE programmer, it is needed to install it beforehand.
  • Arduino IDE. Arudino programming environment, can be used to program the SAMD chips as well if the proper core is installed.
  • Mattairtech ArduinoCore-samd. Arduino core to support the SAMD microcontroller. It is required to be able to use the Arduino IDE with the SAMD microcontrollers.
  • SAMD ISP firmware. This firmware for the SAMD ISP makes it working as an ISP programmer.

ATMEL-ICE

The ATMEL-ICE programmer can be used to program the SAMD chips with the Arduino IDE, Atmel Studio or a command line tool called EDBG. To install the drivers for the ATMEL-ICE it is anyway required to install Atmel Studio 7, even if then Arduino IDE is used then to upload the code. Unfortunately Atmel Studio only runs on Windows (Windows 10 is recommended to have the last version of the studio and of the drivers). To be noted that the drivers to communicate to the SAMD micrcontrollers via USB, will be installed with the Mattairtech ArduinoCore-samd.

To setup the programming via the ATMEL-ICE, follow the steps below:

  • Install Atmel Studio 7
  • Plug the ATMEL-ICE using a USB micro cable
  • Wait for the drivers to be installed
  • Install Arduino IDE

Once the drivers are installed you can connect the board you want to program. Because of the small picth of the ATMEL-ICE connectors, you may need to use the converter board. The following pictures shows how to connect the ATMEL-ICE to the SAMD ISP. If the green LED is on, then ATMEL-ICE successfully detects the connection with the chip that will be programmed.

ice_ispWhen using the Arduino IDE to upload the bootloader or the code, the following options are selected:

program_arduino_ideTo program using the EDBG command line tool follow the steps below:

  • Donwload EDBG
  • Install EDBG in the system path
  • use one of the following commands to upload the code/write the fuses:
    • program: edbg -b -t target_type -pv -f binary_file
    • read fuses: edbg -b -t target_type -F r,*,file_name
    • write fuses: edbg -b -t target_type -F w,high_bit:low_bit,bit_value

SAMD ISP

The SAMD ISP can be used in place of the ATMEL-ICE programmer to upload the code to SAMD microcontrollers. Unfortunately seems that the CMSIS-DAP is not supported by the Arduino IDE as programmer, so the only way to use it (at the moment), is trough the command line tool EDBG.

To program using the EDBG command line tool follow the steps below:

  • Install Arduino IDE
  • Donwload EDBG
  • Install EDBG in the system path
  • use one of the following commands to upload the code/write the fuses:
    • program: edbg -b -t target_type -pv -f binary_file
    • read fuses: edbg -b -t target_type -F r,*,file_name
    • write fuses: edbg -b -t target_type -F w,high_bit:low_bit,bit_value

Following is an image about how to connect the SAMD ISP with a fresh one.

SAMD_ISPExample with the SAMD ISP firmware:

edbg -b -t samd11 -pv -f free_dap_d11c_mini.bin

edbg_windowsType edbg -h to have the explanation about the different parameters. Notable ones are the -t target and the -f that indicates the file you want to upload.

edbg_targetsOnce the SAMD ISP firmware has been uploaded, the programmer will be recognized.

SAMD_ISP_detected_2SAMD_ISP_detected_1In case more than one programmer is connected, it is needed to specify the serial number of the programmer that will be used to upload the code. This can be done by using the -s parameter.

programmer_selectionTo upload a code that has been compiled by the Arduino IDE, it is possible to manually copy the compiled bin from the temp folder the IDE is using to store the builds. To find the path is sufficient to enable the verbose output in the Arduino IDE preferences, and then find the path from the compilation logs.

verbose_arduino_idetemp_buildbin

Directly from USB

Depending on which bootloader you have installed into the SAMD ISP, or other SAM microcontrollers, it is possible to directly upload the code by using the USB connection. The recommended one for uploading code via USB is the MattairTech “Generic D11C14A”, found here: Mattairtech ArduinoCore-samd.

MattairBootloaderOnce the proper bootloader is installed, the board will be recognized by the Arduino IDE, and a new serial port will be available.

MattairTech_bootloaderAt this point to upload the code, you just need to push the upload button of the Arduino IDE.

Downloads

SAMD ISP Files
Software
documentation/electronics/samdisp.txt · Last modified: 2021/02/15 16:00 by daniele