Atmel microcontrollers programmer

This article presents a programmer for Atmel 89C51 flash reprogrammable [1] series of microcontrollers:
-supported MCUs: AT89C51/52 / AT89C1051 / AT89C2051 Flash-based Microcontrollers
-programmer is controlled from an IBM PC compatible computer by using one of the host's parallel ports (an extension card with parallel output, a USB to parallel port adapter or a print server with parallel output)
-schematic diagrams and software application were designed by Atmel Corporation.

The programmer circuitry (see Figures 1, 2 and 3) consists of the host interface and power supplies. The signal sequencing and timing required for programming is generated by the host under software control.

Figure 1
Prog 1 (PDF)
Figure 2
Prog 2 (PDF)
Figure 3
Prog 3 (PDF)

Based on the Intel 8051 architecture, the ATMEL 89 series remains very popular as general purpose, low cost and easy to use microcontrollers. A programmer for these integrated circuits it is not hard to build. Many modern motherboards still have a parallel port onboard, sometimes it is not connected to an outside connector. It is recommended to use this port instead of using other adapters such as USB, PCMCIA (figure 6) or LAN port servers (figure 7). For industrial computers that have ISA bus, in figures 4 and 5 is provided the schematic diagram of an ISA card with parallel interface output. This schematic diagram is also designed by Atmel Corporation.

Figure 4
ISA card 1 (PDF)
Figure 5
ISA card 2 (PDF)
Figure 6
Figure 7

Unfortunately, the manufacturers of modern motherboards and adapter cards doesn't tell how they actually connect the parallel port to the machine hardware, so you may have the surprise of a parallel port that is not bidirectional. However these errors are rare on hardware manufactured by known companies. Also the timings are different according to the PC CPU frequency. In these cases, the program sources in C and assembler languages are provided. The user can make the modifications in sources according to the hardware he have. The timer control code is provided as an 8086 assembly language module, which is linked with the compiled control program. The granularity of the timer is 0.838 microseconds, but the minimum practical delay is system and software dependent. The timer code must ensure the delay produced will not be of shorter duration than requested.

System-dependency results from the use of software timing loops to enforce required delays, the duration of which will vary between host systems running at different speeds. The code provided was tested on an 80386-based system running at 33 MHz and it may require modifications for use on other systems. This method was chosen for its simplicity.

Figure 8 contains the software. Figure 9 shows a multiboot PC configuration [2] with several operating systems, some of them supporting 16-bit operation. In figure 10 is provided Atmel documentation for this programmer.

Figure 8
Software (zip)
Figure 9
Multiboot system
Figure 10
Doc (PDF)

Warning: The executable files provided in this article are 16-bit applications. If necessary, modify and recompile yourself the sources provided. Take into consideration the following facts:
- modern Windows operating systems (including Windows XP, 7, 8, 10 etc) does not support 16-bit programs anymore.
- Microsoft offers a solution by enabling NTVDM feature which usually is not working properly
- as Microsoft in the future heads toward 64-bit computing, the support for many of the legacy components including 16-bit operation will be totally dropped.
- the best solution for using this programmer is to have a multiboot system [2] in your workstation computer and one of the operating system to have 16-bit capability (figure 9)
- other option is to install a DOS in a virtual machine and run the 16-bit programs inside. The results depends on how the virtual machine program emulates the parallel port. This programmer may not work well in such environment.
- in all cases it is necessary to verify with an oscilloscope the timings and voltage levels before connecting the MCU. If the timings have incorrect values, you have to modify the sources and recompile the software.

Disclaimer: The information on this web site is provided "AS IS", without warranty of any kind. The author has made the best efforts to ensure the design and the information provided are reliable. Under no circumstances shall the author be liable for any direct, indirect, incidental, special or consequential loss, damage, expense or injury incurred or suffered which is claimed to resulted from use of this site, even if expressly advised of the possibility of such loss, damage, expense or injury, including, without limitation, any fault, error, omission, interruption or delay with respect thereto.

Links:
[1] - AT89C51 site
[2] - Multiboot computer system