Getting started with ATMEL SAM4S Xplained - WCP52/docs GitHub Wiki

Installation of Atmel Studio and Necessary Drivers

  1. Download Atmel Studio from http://www.atmel.com/tools/atmelstudio.aspx
  2. Run the installer for Atmel Studio.
  3. Download J-LINK drivers from https://www.segger.com/jlink-software.html
  4. Run the installer
    1. You will be asked to choose additional options that should be installed. Here, be sure to check both Install USB driver for J-LINK and Install USB Driver for J-Link-OB with CDC
  5. After these drivers have been installed, connect the SAM4S Xplained board to your PC through the boards USB connections and wait until you receive the message that device drivers have been installed.
    1. First, connect JTAG21, located on the left side of the board.
    2. Second, connect JTAG22, located on the top of the board.
  6. Once these steps are complete, you are ready to program the board.

###Running the first program on the SAM4S Xplained

  1. For the final steps of this section, you will need a terminal that allows communication over serial ports. I recommend using TeraTerm which can be found here
  2. Open Atmel Studio and start a new project.
    1. The New Project window will open. Under Installed Templates, select C/C++, then select GCC C Executable Project.
    2. Name the project anything you wish. 2 lines below Name you will see Solution. Be sure that Create New Solution is selected.
    3. Now, a window will open called Drive Selection. Select SAM4 32-bit from the Device Family drop down menu. Then, select ATSAM4S16C from the table below it. Press OK.
  3. Now, we will load in a project that ATMEL provides for testing.
    1. In the toolbar select View->Start Page. At the start page, click on New Project Example.
    2. A window will open that allows us to select from a wide range of projects for many ATMEL products.
      1. From the Device Family drop down menu, select SAM4, 32-bit.
      2. From the menu on the left, select Kit
      3. Expand the list titled Atmel - Atmel Corp. Then, expand the list SAM4S Xplained. This provides a list of all the example projects we can load. Choose QTouch Method Example Application - SAM4S Xplained, press OK on the dialogue box that appears next and accept the two license agreements.
    3. Be sure that your development board is plugged in. Use JTAG21 USB connector to connect the board to your PC.
    4. In the toolbar select Tools->Device Programming.
    5. Under Tool select J-Link.
    6. Under Device select ATSAM4S16C.
    7. Under Interface, select JTAG and press Apply.
    8. In the pane on the left, select Memories.
    9. Check the box that says Erase Flash Before Programming and click Program. Give your device a few seconds to program.
      1. If everything went well you will see three messages in the bottom pane of this window. Erasing device... OK, Programming Flash... OK, Verifying Flash... OK
  4. Now, your program is running on the development board, to view its output, you need to use the terminal from the first step of this description. From here on, I'll assume that you're using TeraTerm.
    1. Open TeraTerm.
    2. Select the serial port corresponding to your development board (as long as you don't have anything else connected, it will be the only one there) and press OK.
    3. In the task bar, go to Setup->Serial port... and make sure you're setting match the ones listed here and press OK
      1. Baud Rate: 115200
      2. Data: 8 bit
      3. Parity: none
      4. Stop: 1 bit
      5. Flow Control: none
    4. You are all set. Slide your finger across the QTouch pad on your board and you will see values flow into your terminal.

###Pretty sweet, huh?###