I have found a programmer for the AT89C2051 microcontroller here:


I have created a version similar to it. What's common with both versions is that none have a diode between the VPP pin and 12V. Just a resistor only.

My programmer does work but after several programming attempts (way less than 1000 per chip), the chip decides to no longer be programmable.

I remember that someone suggested that I should use a diode and a resistor between VPP pin and 12V.

So I'm curious as to what diode is best and what makes it so beneficial?

In the future, I want to program the AT89C4051 with the same programmer.

  • \$\begingroup\$ The link you provided does not define a Vpp pin. \$\endgroup\$ – Sparky256 Feb 9 '18 at 1:02
  • \$\begingroup\$ VPP is the reset pin for the AT89Cx051. I guess the author of that schematic didn't recognize it as a VPP. \$\endgroup\$ – user152879 Feb 9 '18 at 1:42

Normally a Vpp has other duties when not being used for programming, such as RST. Typical wiring is a resistor and diode in series to a 5 volt source, and a connection through a resistor to a normally OFF 12 volt source. When the Vpp pin senses 12 volts in puts the IC into program mode.

The diode is to prevent 12 volts from feeding back into the 5 volt line, which normally has a 10K ohm or so pull up resistor to 5 volts to reset the IC.

I suspect your IC is being damaged by having the 12 volts ON all the time, acting also as a pull up for the RST pin. Under normal operation it is connected to ground through a 10K resistor.

The 12 volts should be turned OFF the moment programming is done.

  • \$\begingroup\$ Is that circuit I presented in my question a bad way to turn the 12V off? I mean I'm using a simple NPN switch and if enough +ve voltage enters NPN's base, then the collector (which is connected to reset) is set to 0 volts. Otherwise, its set to 12V. Or wait. am I better to just use a pull-up resistor on the NPN base to default it to output 0 volts at collector? \$\endgroup\$ – user152879 Feb 9 '18 at 1:41
  • \$\begingroup\$ The problem is you have no resistor-diode connection from /RST to the 5 volt line, to keep /RST high so it does not reset. The diagram is wrong in that sense. The 12 volts should only be ON when programming the IC. \$\endgroup\$ – Sparky256 Feb 9 '18 at 1:52
  • \$\begingroup\$ On an AT89Cx051 in normal mode, reset happens when that pin is 5V. Page 3 of the manual states this: rigpix.com/components/at89c2051.pdf. Should I have a diode in series with a resistor from reset to ground? I'm still a bit confused with the diode reasoning. Maybe I need pictures of current flow in the circuit and how a diode can be beneficial \$\endgroup\$ – user152879 Feb 9 '18 at 2:06
  • \$\begingroup\$ Ok. Thanks for the manual. You do need a 10K resistor to ground to avoid a reset. Raise the RST pin to 12 volts only for programming. When not programming it must be at ground potential. Use ONLY 5 volts to reset the IC. No diode needed. \$\endgroup\$ – Sparky256 Feb 9 '18 at 2:14
  • \$\begingroup\$ I have corrected my answer to match 5 volts as being the reset voltage. Diode may still be needed if chance of reset being issued during programming. 12 volts must NOT be fed back into the 5 volt line. \$\endgroup\$ – Sparky256 Feb 9 '18 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy