Flash Memory Programmer


I recently had a need to program some STS 39SF512 Flash devices but I didn't have access to a programmer. I took a look at the specifications and thought that the programming procedure was simple enough that I ought to just build one. I had also recently gotten an Atmel STK500 development board for the AVR microcontrollers along with an ATmega16 so I thought that this would be a good project to learn something about the AVRs while accomplishing my original goal.

To keep things simple, I decided to use as much of the capability on the STK500 as I could. I ended up using the AVR programming interface and the RS-232 level converters. In the picture above (click to enlarge) the STK500 is in the upper part of the picture and my prototype board is in the lower part. The components on my prototype board are the Flash device (in a PLCC-32 to DIP adapter), the 40-pin ATmega16, a crystal and a couple of caps. There is also an LED on the A8 line to the Flash device that blinks on and off as the device is being accessed.

The gray ribbon cable running from the prototype board to the STK500 connects the 6-pin programming header to the AVR. The longer, multi-colored ribbon cable connects the serial in and serial out pins of the AVR to RS-232 level converters on the STK500 which are connected to the auxiliary serial port connector.

A schematic for the programmer can be viewed as an image here or downloaded as a schematic file here. It was created using the free ExpressSCH schematic drawing program that can be downloaded using the link below. That program is the best means to view or print the schematic.

The code for operating the programmer was built in two parts, both written in C. The part that runs on the AVR receives commands and data from the master over the serial link. For read operations, it also sends data back to the master over the serial link. All data in transferred in Intel hex format records. A zip file with AVR C code, a makefile, the schematic and a readme file may be downloaded using the link below. The C code may directly viewed here. There is a large block of comments at the top of the file that describes the connections between the Flash device and the AVR as well as the command protocol between the programmer and the master.

The code for the master was written to run as a Win32 console application. It has a fairly simple command line user interface with commands to erase, write, verify and read Flash devices. A zip file with the Win32 executable for master app, the C code and MS Visual C workspace and project files for building it may be downloaded here.

If you wish, you may email me with questions or comments.

Zipfile: AVR C code, makefile, schematic
Zipfile: Win32 Console App executable, source and MSVC project file
Link to page to Download ExpressSCH