An AT89LP51ED2/RD2/ID2 device programmer

Discussion in 'The Completed Projects Collection' started by cmartinez, Apr 8, 2018.

  1. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    Here's a not-so-little project that I had to complete so I could work on a set of other important projects.

    A couple of years ago, I bought a $69.00 dlls programmer from MikroElektronika that (they claim) is capable of programming the AT89 family of Atmel's line of 8051 MCU's . The fact is that I'm very pleased with it and I've been successfully using it to program AT89LP4052 and AT89LP2052. These are chips with a program memory size of 4 and 2 KB, respectively.

    After a few weeks of using that programmer, I started working on a project that required a much larger chip. And after some searching, I stumbled upon the magnificent AT89LP51ED2, which boasts a full 64KB program memory size (which is the largest size available in the 8051 architecture), 4 KB of EEPROM, 32 fully configurable inputs/outputs, and many other rather attractive features.

    Horror of horrors! :eek: ... I soon discovered that my very useful Mikroe programmer did not support that particular chip! ... I have to admit, it was mainly my fault not knowing about that weakness for not thoroughly studying its specs when I bought it.... So I emailed for support, and I was candidly informed that there were no plans in the near future to update its software to include the AT89LP51ED2 in its programming capabilities... bummer... :(

    Life went on, and the use of this chip became imperative for my projects. A year and a half after that, I emailed them again... and got the same terse answer... there were no plans to support that chip. :mad: Now I was angry... Why were this guys postponing performing a simple update to their software to include the chip I was requesting? ... laziness, lack of financial gain? ... whatever, dude ... I was now very upset :mad:...

    So I did some more searching, and found two or three programmers out there that had a starting price of only $1,300.00 usd :eek:! (some of them cost more than $3,000.00 usd! :eek:) ... I did find a couple of sites from India that used to sell an affordable programmer ... but they were either out of stock, or the site looked a little too seedy for my taste and did not gain my trust.

    It was then time to take things into my own hands.

    I thoroughly read the AT89LP51ED2 datasheet, and dedicated a full week's worth of my time to designing the circuit, building it, and developing its firmware and software.

    And here it is! For free! (yes, Mikroe, you can now do whatever you want with my request for support :mad:) yes, it's FREE! as in Free Admission!, No Cover Charged! it's Open House! ... But it's not like "free beer" ... you still have to build it yourself :p ... There's only one caveat: a way to program an AT89LP4052/2052 chip is needed to build this thing (the source code for the AT89LP4052 is included in this post, though). But I've realized that that could be accomplished (although in a very slow way) by using the auxiliary I/O pins of the MCP2221A usb to uart converter, and writing the appropriate software for that. But I'll leave that sub-project to other members of this forum ... see if they're feeling as generous as I am.

    The device draws power from the USB port and does not need an external power supply.

    Here's the PCB layout:


    Attached are the complete ASM and HEX files (which are thoroughly commented by me), and an AutoCAD 2010 DWG file. I've also added a DXF of said file to make it easier to open in other platforms.

    Top cropped.jpg

    Bottom cropped.jpg

    Here's the parts list:

    1 x PCB
    4 x standoffs and phillips screws
    1 x 40-pin ZIF (Aries Electronics 40-6554-10)
    1 x 20-pin ic socket
    2 x 14-pin ic sockets
    4 x puhsbuttons, NO
    1 x 14.7456MHZ crystal oscillator, through-hole ( Ecs Inc, ECS-147.4-18-4XEN)
    1 x 14.7456MHZ crystal oscillator, SMT (Ecs Inc, ECS-147.4-S-20A-TR)
    1 x 5mm LED
    8 x micro LEDs
    1 x AT89LP4052 (or 2052)
    2 x MCP2221A USB to UART converters
    2 x mini USB pcb female connectors (GCT USB2066-05-RBHM-15-STB-00-00-A)
    Resistors, SMT (0805):
    9 x 270 ohms
    1 x 1 k
    2 x 4.7 k
    1 x 100 k
    Capacitors, SMT (X7R, 0805)
    6 x 100 nF
    2 x 200 nF
    2 x 10 pF​

    The total cost of all pieces shouldn't be more than $25 bucks ... the most expensive part is the ZIF socket, which retails at around $15.00 dlls, but I consider it essential if one wants to actually work with this thing, and not just play around.

    I'm rather proud of the VB.NET software I wrote :cool: ... which is also attached along with its source code, and has been thoroughly commented :)


    The software is reliable and it's very fast. That's because the device programs the AT89LP51ED2 in parallel mode, and not in the more popularly used serial mode. It is capable of fully programming all 64KB of available code space in only 12 seconds! (yes, I actually tested it, and clocked it :cool:) And much less if the program is small, which it usually is. For instance, burning a 1KB program takes less than two seconds! ... Of course, the software is not perfect, since I never intended to exploit it commercially, although I've included popup comments on most of its components to make it easier to use and understand.

    An important note: I discovered that the device loses sync and behaves erratically if the chip is placed in its programming socket while it's connected (and hence, powered up) to the computer's USB port. It's best to first plug the chip in, and then to connect the device to the USB port; and finally to run the programming software. An important improvement could be made if a gated supply to the chip that would turn it on and off prior to and after programming were to be added. This could be done by using one of the available i/o pins of the MCP2221A to control a mosfet that would apply power to the device.

    @JohnInTX, please let me know what else is needed for this thread to be moved into the completed projects forum.

    @Papabravo, I'm sure you'll find this little project of mine to be of your interest. (In other words: please allow me to show off a bit ... :cool::D) ... many thanks for all the help you've given me in the past. :)

    Here's the complete schematic. I've attached its image, and the AutoCAD dxf file.


    The project is now complete ... :cool:
    Last edited: Apr 15, 2018
    JohnInTX and be80be like this.
  2. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    And by the way, I know that the AT89LP51ED2 has an internal bootloader that can be used to program it through a software called FLIP, but for some unknown reason I could never make that thing work.

    Besides, using the bootloader imposes some programming restrictions, and doing things the way I did fully unlocks all of the chip's capabilities. And it adds the advantage of extremely fast programming .
    Last edited: Apr 9, 2018
    JohnInTX likes this.
  3. Papabravo


    Feb 24, 2006
    Very nice. We used FLIP to great effect in programming chips after they had been placed on the PC Board. This was a major improvement over using the OTP from Siemens. Those fargain bastages defaulted on an order of 1000 pieces with a 26 week leadtime. 26 weeks went by and the Siemens rep told us to go stuff ourselves, the parts were on allocation for their "German" customers. We turned our design to use the Atmel chip in 24 hours. Thanks be to Atmel with Flash Memory and FLIP; they delivered the 1000 pieces the next week.
    cmartinez likes this.
  4. be80be

    AAC Fanatic!

    Jul 5, 2008
    Really nice work.
    cmartinez likes this.