Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Parallel programmer for AT89. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

The MSC-51-compatible Atmel AT89C series microcontrollers with a parallel programming interface attract the attention of radio amateurs with their wide capabilities at a relatively low cost. Unfortunately, many programmers common today are unsuitable for them. You need a specialized one. The author of the proposed article managed to make one according to the recommendations of Atmel, but on an element base produced by CIS enterprises.

The main problem in the development of a homemade programmer is to know and strictly follow the programming algorithms of microcontrollers. Many surprises can be avoided by using circuits and software published by chip design firms.

To load program codes into AT89C51, AT89C52, AT89C1051, AT89C2051, AT89S8252 microcontrollers, Atmel recommends the device described in [1]. Its relative complexity (seven digital and two analog chips) and modest software running under DOS are more than compensated by the reliability of programming in compliance with all proprietary algorithms.

On fig. 1 shows a diagram of a programmer that differs from the "proprietary" one mainly in the element base. Recording in the registers DD2-DD5 of information coming from the computer via the DATA1 DATA8 lines occurs according to the decay of negative polarity pulses at the inputs C coming from the decoder DD1. bytes of data to be written to this cell in DD3 and address-free bits DD4 - control codes. The R13C5 circuit, when the power is turned on, resets the DD2 register, preventing accidental distortion of the contents of the memory of the programmable microcontroller.

Parallel programmer for AT89
(click to enlarge)

Bus driver DD6 is used to transfer data from the microcontroller outputs to the DATA1-DATA8 lines. The outputs of the DD6 chip should not be active when the LPT port is working "on output". This is taken into account in the program that generates enabling signals at the control inputs of the microcircuits.

Resistors R1-R12 reduce the "ringing" that accompanies signal drops on the lines of the LPT port and protect it from overloads. When the outputs of the computer elements connected to the port lines, and the outputs of some programmer elements, including the programmable microcircuit itself, are in a high-impedance state, the resistors of the DR1-DR3 sets maintain a high logic level in the corresponding circuits.

Programmable microcircuits are installed in one of two panels: AT89C1051, AT89C2051, AT89C4051 in the DIP-20 package - in XS1; АТ89С51 and others in DIP-40 package - in XS2. A 1 MHz ZQ6 crystal with capacitors C4 and C5 is required for the internal clock generator of the microcontroller installed in the XS2 panel to work during programming. Those installed in the XS1 panel do not require a resonator. Pin 5 of this panel receives clock pulses generated by software.

The supply voltage to the connector X1 of the programmer is supplied from an external source. It can be, for example, the network adapter of the "SEGA Mega Drive-M" video set-top box. Although at a nominal load (1 A) its output voltage does not exceed 11V, at a current of 70 ... 90 mA consumed by the programmer, it rises to 14 ... 15 V.

A voltage of 5 V for powering microcircuits (including a programmable one) is obtained using an integrated stabilizer DA1. The voltage at the output of the stabilizer DA2 at a low logic level at pin 18 of the bus shaper DD7 is 12 V. The exact value is set by the tuning resistor R21. At a high logic level at pin 18, the opened transistor VT2 connects another tuning resistor R21 in parallel to R19, which reduces the output voltage of the DA2 stabilizer to 5 V.

The rate of rise of the voltage at the output of the stabilizer after changing the high level at pin 18 DD7 low depends on the capacitance and capacitor C14. If its capacitance is too high and the control computer operates at a high speed, several lower cells of the FLASH memory of the microcontroller may be programmed with errors.

The output voltage of the stabilizer DA2 is supplied to pin 31 (EA / VPP) of the XS2 panel directly, and to pin 1 of the XS1 panel (RST / VPP) - through the switch on the transistor VT1. At a voltage of 12V, the key is open regardless of the logic level at pin 16 of register DD2, and at 5V, only if this level is low.

The reduced brightness of the HL2 LED indicates a voltage of 5 V at the DA2 output and that the programmable microcircuit is in the mode of reading codes from its memory. In the erasing and writing to memory mode, the voltage increases to 12 V, the brightness of the LED increases noticeably. This is true for all microcontrollers, except for those that do not require 12 V. When programming twenty-pin microcontrollers, the HL1 LED will also be on.

The X2 plug of the programmer is connected to the socket of the LPT port of an IBM-compatible computer with a cable up to 2 m long. The extended mode of the LPT port (ECP / EPP) must be enabled in the computer. In modern system units, it operates by default. If this is not the case, the port mode can be changed by running the BIOS SETUP program when the computer boots up (menu items "Integrated Peripherals" - "Parallel Port Mode").

DETAILS AND CONSTRUCTION

The programmer is assembled on a double-sided printed circuit board measuring 140x140 mm. Stabilizer DA1 is installed on a heat sink with an area of ​​at least 20 cm2. You can also assemble the programmer on a breadboard by surface mounting. Please note that the capacitors C4, C5 and the quartz resonator ZQ1 should be located as close as possible to the contacts 18, 19 of the XS2 panel. Free inputs of microcircuits DD1 (pins 13-15), DD2 (pin 8) and DD7 (pins 15, 17) must be connected to their common or power output. This will increase the noise immunity of the device.

All digital microcircuits can be replaced by their functional analogues of the K555, KR1533 series or imported ones, using, for example, recommendations [2]. Transistors VT1, VT2 - any low-power corresponding structures, preferably with a minimum voltage drop in the collector-emitter section of an open transistor.

Trimmer resistors R19, R21 - SPZ-19A. Sets of resistors DR1-DR3 - NR1-4-9M can be replaced by NR1-4-8M, by foreign series 9A or by the corresponding number of conventional small-sized resistors indicated in the rating diagram. Resistors R1-R12 can be placed inside the X2 plug housing.

The XS1 and XS2 panels must be able to withstand repeated insertion and removal of chips. It is best to use ZIF panels (zero insertion force) designed for chips with a distance between the rows of contacts 7,5 mm (XS1) and 15 mm (XS2). Universal panels are also suitable, allowing the installation of both "narrow" and "wide" microcircuits.

Considering that ZIF panels are several times more expensive than all other parts of the programmer taken together, the board provides contact pads for installing conventional ones, preferably with collet contacts. It is undesirable to use the cheapest panels with flat contacts. After numerous replacements of the microcircuit, such contacts lose their reliability.

FORMING

The first inclusion of the programmer is carried out without connecting it to a computer and without a programmable microcircuit. First of all, they check the presence of a voltage of 13,5 ... 15,5 V at the input and 5 ± 0,1 V at the output of stabilizers DA1, DA2. In the latter case, the desired value is set by the tuning resistor R19.

When connecting pins 1 and 10 of the DD6 microcircuit, the voltage at its pins 3, 5, 7, 9, 12, 14, 16, 18 should decrease from 5 to 3 ... 4 V. If this is not the case, there are installation errors or the DD6 chip is faulty.

For further verification, connect the programmer to the computer. The signals on the lines of the LPT port during the operation of the programmer look rather chaotic on the oscilloscope screen, it is difficult to judge the health of the device by their shape. It is recommended to run a test program atmeltst.exe. In response to the prompt that appears on the screen, enter the number of the LPT port to which the programmer is connected (1 or 2), after which the monitor screen will take the form shown in fig. 2.

Parallel programmer for AT89

The program provides access to any of the four registers DD2-DD5, allowing you to write any eight-bit binary codes into them. The recommended sequence of actions will be prompted by the text at the bottom of the screen. For example, to check the passage of control codes, select the line "Test signals F3, C0-C2" on the screen and check the logic levels at the outputs of the DD2 chip using an oscilloscope or voltmeter. All of them should be low and change to high when you press the corresponding keys F1-F8.

By manipulating the state of the bits, they check the passage of signals through the circuits of the programmer in accordance with its scheme. For example, a low level at pin 19 DD2 (high order of the register) should correspond to a high level at pin 18 DD7 and a voltage of 5 V at the output of the DA2 stabilizer. After pressing the F8 key, the voltage should increase to 12 V and at the same time the brightness of the HL2 LED should increase. After pressing the F8 key again, the voltage and brightness should return to their previous values.

Other registers and the circuits connected to their outputs are checked in a similar way.

PROGRAMMING

Atmel's free programmer maintenance software package can be found on the Atmel website at The programs included in the package are suitable for managing both "proprietary" and those offered by programmers. However, it is better to use a Russified program at89.exe. With its help, you can program all microcontrollers of the AT89 series with a parallel interface, including AT89C4051, AT89C55, AT89S51, AT89S52, AT89S53, "not covered" by the proprietary package.

The program automatically determines the type of the microcontroller installed in one of the panels, analyzing for this its signature - two or three bytes specially recorded in the permanent memory. The list of signatures of microcontrollers of the AT89 family is given in the table. If all bytes of the signature are equal to 0FFH, the microcontroller is missing from the panel or the microcontroller is faulty, and possibly the programmer is not powered on.

Parallel programmer for AT89

The programming algorithm and the list of keys that control the process are left unchanged. The recommended operating environment is MS DOS. Windows users should run the program after restarting the computer in MS DOS mode or set this mode in the file properties. Otherwise, the programming of microcircuits will have to be repeated three or four times in a row until verification error messages stop.

The entire programming process takes no more than one or two minutes, and the actual loading of the FLASH memory takes a maximum of 10 ... 15 s. The commands, the list of which is displayed on the monitor screen, are given by pressing the keys with the letters of the Latin alphabet. Case (upper or lower) does not matter.

The name of the binary file, the data from which should be loaded into the memory of the microcontroller, is entered after the command "Read file" is given. The contents of this memory can be preliminarily read and saved in a similar file (the "Write to file" command). When checking the contents of memory with data from a file (the "Check with file" command), messages similar to the following may appear on the screen:

In cell FLASH 039A = FF?! 6V

This means that in the FLASH-memory cell (program memory) of the microcontroller at address 39AH, the code 0FFH is written instead of 6BH specified in the file.

REPLACING STABILIZER DA2

When powered by a low-power AC adapter and a reduced network voltage, only 12 ... 13 V can be supplied to the programmer. For the DA1 stabilizer, this situation is favorable (less power is dissipated on it). But the DA2 stabilizer can exit the operating mode, as a result of which the voltage supplied to the programmable microcontroller drops below the permissible 11,5 V. Experience shows that Atmel microcircuits are successfully programmed even at 10,5 V. However, this cannot be guaranteed.

If you use the KR1184EN2 chip or its prototype LP2951CL from National Semiconductor in the stabilizer (available on many computer motherboards), you can achieve reliable operation of the programmer when the supply voltage is reduced to 11,8 V.

The stabilizer is assembled according to the scheme shown in Fig. 3 and connected to those shown in fig. 1 points A, B and C. Chip DA2, transistor VT2, resistors R18-R21 and capacitor C14 from the programmer must be excluded.

Parallel programmer for AT89

Diode VD1 (see Fig. 3) at a high logic level at point A is closed, and the output voltage of 5 ± 0,03 V sets a precision voltage divider located inside the DA1 microcircuit. At a low level at point A, the diode is open, resistors R1 and R2 shunt one of the arms of the internal divider. The output voltage rises to 12 V (it is regulated by a trimming resistor R2). Capacitor C1 suppresses voltage surges during transients. Its capacitance (similar to capacitor C14 in Fig. 1) should not be too large.

The KR1184EN2 microcircuit has an internal output voltage drop detector, which is triggered when it decreases by more than 5% of the set value. As a result, the transistor VT1 opens and the HL1 LED turns on. The load capacity of the output is small, so the value of the resistor R4 cannot be reduced.

If the KR1184EN2 (LP2951CL) chip could not be purchased, the stabilizer on the DA2 chip (see Fig. 1) can be replaced with a node, the diagram of which is shown in Fig. 4. The minimum voltage drop on it will be 0,15 ... 0,2 V at a load current of 20 mA. The collector current of the transistor VT4 with the value of the resistor R5 indicated on the diagram cannot exceed 50 mA, which makes it possible not to install this transistor on a heat sink.

Parallel programmer for AT89

At a low logic level at point A, the transistor VT1 is open and the output voltage of the stabilizer is 12 V (regulated with a tuning resistor R1). At a high level and a closed transistor, it will decrease to 5 V. Resistors R7 and R8 must have a maximum deviation from the nominal value of no more than 1% or be selected with such accuracy. The KR142EN19 chip can be replaced with an imported analog TL431CLP.

Programs and drawings of the printed circuit board of the programmer

Literature

  1. Using a Personal Computer to Program the AT89C51 /C52/LV51 /LV52/C1051 /C2051. -
  2. AT89 Series Programmer Interface -
  3. Ryumik S. Replacing chips in a proprietary programmer. - Radioworld. Your computer, 2003, no. 5, p. 32-34.

Author: S.Ryumik, Chernihiv, Ukraine

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Iogear GTD733 Docking Station 12.07.2017

The Iogear range has been expanded with the GTD733 docking station. It allows you to connect monitors, drives and other peripherals to a computer with a Thunderbolt 3 port. The second Thunderbolt 3 port on the dock can daisy chain up to five more devices.

Iogear GTD733 configuration includes three USB 3.0 ports. Two of them are connected to the USB-A connectors, one is connected to the USB-C connector. In addition, there is a Gigabit Ethernet port, microphone and headphone jacks, DisplayPort video output. DisplayPort and USB-C ports can connect 4K or 5K monitors.

A cable for connecting to a computer and an external power supply are included.

The recommended price of the device is $300.

Other interesting news:

▪ Single Board PC LattePanda 3 Delta

▪ The dangers of riding electric scooters

▪ Mini computer Zotac ZBox Nano D518

▪ Hyperloop overclocked to 1019 km / h

▪ Glass to protect secrets

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Aphorisms of famous people. Article selection

▪ article The dead have no shame. Popular expression

▪ article Where can I catch candlefish? Detailed answer

▪ article Shcheritsa. Legends, cultivation, methods of application

▪ article Artificial horn. Simple recipes and tips

▪ article Scheme for powering LEDs with a power of 5 watts of the LUXEON V type. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024