Program 8051 (AT89 Series) With Arduino




1 Teacher Note

Introduction: Program 8051 (AT89 Series) With Arduino

This guide provides a complete solution to program the AT89S51 or AT89S52 (these are what I have tested) with an Arduino. Multiple setups are included in this guide; the easiest setup requires no additional software other than the Arduino IDE.

1 Teacher Note

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Wire the AT89S52 As You Would Normally Do

Feel free to skip this step if it is already wired.

What you usually need to set up a minimum system for AT89S52:

For clock:
1x Crystal Oscillator, less than 33Mhz
2x Capacitors, about 33pF depending on which crystal you use

For the reset circuit:
1x 10kOhm Resistor
1x 10μF Capacitor

The microcontroller can definitely run without the reset circuit, you just have to manually reset it after powering it up.

You can also use one of those minimum system boards. If this is the case, go ahead and skip to the next step.

Step 2: Wire the AT89S52 to the Arduino

The AT89S52 (AT89S51 too) uses SPI as the ISP protocol. It enters ISP mode when RST pin is pulled high.

Wiring in addition to that of Step 1:
RST pin on the 8051 to pin 10 on the Arduino;
Pin 8 (P1.7) on the 8051 to pin 13 on the Arduino (SCK);
Pin 7 (P1.6) on the 8051 to pin 12 on the Arduino (MISO);
Pin 6 (P1.5) on the 8051 to pin 11 on the Arduino (MOSI).

Step 3: Programming Using My Software (Skip to Step 4 If You Want to Use Avrdude)

From here:

Upload the sketch contained in the repository and you can start programming your AT89S51(52)!

Step 4: Programming Using Avrdude

The Arduino IDE comes with avrdude preinstalled. Even better, ArduinoISP, which also comes with the IDE, supports AT89S51(AT89S52).

First, upload the sketch named "ArduinoISP" onto your arduino. The sketch can be found under "File" -> "Examples" -> "11.ArduinoISP" in the Arduino IDE.

Then, you have to customize the configuration file of avrdude in order to enable support for our AT89S51(52). You can download an already modified configuration on this page.

Double check your wiring, if everything seems OK, run the following:

"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe" -C E:/avrdude8051.conf -c stk500v1 -P COM3 -p 89s51 -b 19200

(You might want to replace the path to "avrdude.exe" with your installation path of the Arduino IDE. Replace "COM3" with the serial port name of the arduino you use as the programmer. Replace 89s51 with 89s52 if you have an AT89S52. Replace "E:/avrdude8051.conf" with path to the configuration you just downloaded.)

Step 5: Programming Using Avrdude (Cont'd)

Your setup is correct if avrdude outputs the device signature correctly.

To upload a program, run the command in the previous step with one extra option:


To verify, run avrdude with:


For further information regarding the usage of avrdude, consult its manual at:

Be the First to Share


    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    9 Discussions


    Question 6 months ago

    Hi. He has given me some micro P80C31BH and is looking to use this post, but I have mounted it and it does not work for me.
    What is the difference of At89s51 and P80c31?
    Is it the same in the case of 80c31?

    Ravi ravnang
    Ravi ravnang

    9 months ago

    I am using AT89S52 and following the circuit as shown above. The Arduino program is being loaded on the Arduino Uno board without any error. But, the chip is not getting detected in the SPI programmer! As a result, i cannot burn the Hex file! Please help to as to what can be wrong?
    Please help


    Question 1 year ago on Step 4

    avrdude.exe: can't open config file "stk500v1" no such file or directory
    Help please


    1 year ago on Step 5


    Why this error caused? explain plz.
    stk500_recv(): programmer is not responding
    avrdude.exe: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03


    Question 1 year ago on Introduction

    How can 89C52 be programmed with arduino? It is low cost than 89S52 but with the above tutorial, it is not working. 89S52 is working fine


    Question 1 year ago on Introduction

    Hello...what should I do after connecting as per given on the sketch?please make an YouTube tutorial about it...or send me step by step guide to my mail account am doing project...burner kit is


    2 years ago

    I'm getting "Device signature = 0x7f7f7f, Expected signature for AT89S51 is 1E 51 06, Double check chip or use -F to override this check".

    What could be the problem? Please help. Thanks!


    2 years ago

    I lost my code (one of many) with failure of hdd. I need to modify something and i can't. Its 8051 (AT89S52), is there any chance to read it back ? Thanks