Marko Mäkelä’s software projects: Compact In-System Programmer for Atmel AVR®

What?

The cisp program provides read and write access to the flash and EEPROM memories of Atmel AVR® microcontrollers via the Atmel serial programming interface (SPI) on Unix-like systems and Windows computers equipped with a serial or parallel port.

Why?

I wrote this program, because I wanted that the end users of my C2N232 adapter can easily update the firmware.

Existing solutions supported only either Unix-like systems or Windows and did not support the kind of RS-232 programming interface that was needed.

Before writing cisp, I used UISP. I wanted to avoid C++ and write table-driven object oriented C instead.

Update 2007-09-30: AVRDUDE offers a superset of the features of cisp. I do not indend to maintain cisp any more.

Features

Supported Devices

The table of supported devices is in the file spi.c. Currently, cisp supports the following devices: AT90S1200, ATtiny12, ATtiny15, AT90S2313, AT90S2343, AT90S2323, AT90S2333, ATtiny22, AT90S4414, AT90S4434, AT90S4433, AT90S8515, AT90S8535, ATmega8, ATmega161, ATmega163, ATmega16, ATmega323, ATmega64, ATmega103 (old and new version), and ATmega128. The author has tested the AT90S2313, ATmega103 (old version), and ATtiny12.

Here is an example of adding support for a new device, the ATtiny2313. Not all of its programming protocol has been implemented in cisp, but flash programming does work with the following entry.

diff -pu cisp-1.0.5/spi.c cisp/spi.c
--- cisp-1.0.5/spi.c	2005-08-06 16:40:59.000000000 +0300
+++ cisp/spi.c	2007-05-18 17:39:34.000000000 +0300
@@ -245,6 +245,7 @@ static const struct avr devices[] =
     { 0x91, 0x03, "AT90S2323",   2048,  0,   128,  4, 4, -1,  0 },
     { 0x91, 0x05, "AT90S2333",   2048,  0,   128,  4, 4, -1,  0 },
     { 0x91, 0x06, "ATtiny22",    2048,  0,   128,  4, 4, -1,  0 },
+    { 0x91, 0x0A, "ATtiny2313",  2048, 32,   128,  5, 4,  0,  0 },
     { 0x92, 0x01, "AT90S4414",   4096,  0,   256,  4, 4, -1,  0 },
     { 0x92, 0x02, "AT90S4434",   4096,  0,   256,  4, 4, -1,  0 },
     { 0x92, 0x03, "AT90S4433",   4096,  0,   256,  4, 4, -1,  0 },

Supported Cable Layouts

New cable layouts can be added to the table in comm/commsel.c. The supported RS connections are: c2n232, dasa, and ponyprog. The supported cables for the parallel interface include dapa, dt006, and STK200 (or STK300). Except for c2n232, these are a subset of the interfaces supported by UISP.

Version History

April 2, 2002: Version 1.0
The program has been tested on GNU/Linux and on Microsoft Windows.
April 24, 2002: Version 1.0.1
Added FreeBSD support. No changes in functionality since version 1.0.
November 3, 2002: Version 1.0.2
The program no longer aborts if it receives unexpected don’t care bits in response from the SPI device.
June 12, 2003: Version 1.0.3
The program does not report unexpected responses unless the -d parameter is specified. The program is included in the AVR Cross Development Kit for RPM-based GNU/Linux distributions.
December 18, 2003: Version 1.0.4
Corrected an error in the programming algorithm that caused writes to some AT90S2313 devices to fail.
August 6, 2005: Version 1.0.5
Added option -p for disabling byte polling, as it does not work reliably some devices. Corrected a bug in option -L (writing to EEPROM). Previous versions of cisp would send the wrong command to the device, writing to Flash ROM.

Download

Source code
Executable code for Microsoft Windows