Starting Electronics Needs Your Help!
It is that time of the year when we need to pay for web hosting and buy new components and equipment for new tutorials. You can help by making a donation. Contribute to this website by clicking the Donate button. The total will be updated once daily. (You may need to clear your browser cache to see the updates.)

Target Amount: $2000
Amount Raised: $118

Donations Received


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 Atmel website on the Atmel SAM-BA In-system Programmer page.

To get the software, you will need to register using your name and email address. Just click register on the page as show below circled in red.

Getting the SAM-BA In-system programmer software from Atmel

Getting the SAM-BA Software

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