Starting Electronics needs your help! Please make a donation to help cover our hosting and other costs. Click the donate button to send a donation of any amount.

Programming the AT91SAM7S-EK using SAM-BA

Created on: 23 October 2012

The AT91SAM7S256 microcontroller on the AT91SAM7S-EK evaluation board from Atmel can be programmed via the board's USB port without the need for any external programmer.

Any board containing an AT91SAM7S USB microcontroller that is configured for USB programming can also be programmed in the same way. The article on the hardware requirements for AT91SAM7S USB programming has more information on how the hardware must be set up.

Software Requirements

The SAM-BA bootloader is already programmed into the AT91SAM7S256 microcontroller. All that is needed is to load it into the Flash memory of the microcontroller. This is done using a jumper on the AT91SAM7S-EK board and will be explained shortly.

A software program needs to be loaded on the PC that will transfer the firmware from the PC to the AT91SAM7S microcontroller. This is a free software program that can be downloaded from Atmel.

Getting the Software

The SAM-BA PC software can be downloaded from the Microchip website on the Microchip SAM-BA In-system Programmer page.

Install the software by running the downloaded file and following the installation instructions.

Programming the AT91SAM7S-EK Board

First load SAM-BA to the Flash memory of the AT91SAM7S microcontroller:

  1. With the power to the board off, close the TST jumper
  2. Power up the board by plugging it into the USB port of the PC for 10 seconds
  3. Unplug the board from the USB port and remove the TST jumper
  4. The SAM-BA bootloader is now loaded to Flash memory and will run the next time that the board is plugged into the USB port

When the AT91SAM7S-EK board is plugged into the PC with the SAM-BA bootloader in Flash memory, the driver for SAM-BA will load in Windows. If it is the first time that the board is being used, Windows will install the driver.

You can now start the SAM-BA PC software and connect to the board. A new user firmware program can be loaded to the Flash memory using the SAM-BA software. The new firmware program will overwrite the bootloader when loaded to Flash memory, so you will need to reload the bootloader using the TST jumper the next time that you want to load newer user firmware to the microcontroller.

This video shows how to load the bootloader using the TST jumper and then load firmware to the microcontroller using SAM-BA.

Can't see the video? View on YouTube →

Documentation / Datasheet for SAM-BA

After installing the SAM-BA software on your Windows PC, you can find the SAM-BA User Guide under Start → All Programs → Atmel → SAM-BA v2.12

New Book: Explore ATtiny Microcontrollers using C and Assembly Language

Explore ATtiny Microcontrollers using C and Assembly Language book Ultimate Arduino Uno Hardware Manual

As an Amazon Associate I earn from qualifying purchases: