Introduction: How to Program 8051 Using Arduino!

About: Hi, I'm Nemeen, Electronics Enthusiast! I have seen a huge decline in electronics hobbyist in past few years. I started this channel in order to inspire you to create. Hopefully, you will find something that …

In this tutorial, I will show you a really quick and easy way to program 8051 using an Arduino so without any further ado let’s get started!

Prerequisites- I'll recommend going through my previous article where I have shown you how to build an 8051 Minimal System

Note- this method will only work with AT89S51, AT89S52 and might work on P89V51RD2(i haven't tested this IC as I cannot get my hands on one of those)

Supplies

  1. Arduino Uno
  2. Jumper cables
  3. AT89S51/2

Step 1: Watch the Video!

Step 2: Connections on 8051 and Arduino

first, of we need an 8051 board and an Arduino UNO use UNO only because Nano or Pro mini won’t work as they cannot provide enough current for IC to work properly.

Next, take some Jumper cables and connect 5V and GND of Arduino to 8051 after which Now connect Reset MOSI MISO and SCK pins of 8051 to Arduinos, Pin 10 11 12 and 13 respectively, now if you are working on breadboard don’t worry you can check the datasheet of IC to find these pins,

Now that is complete you can connect the Arduino to your computer and now connect EA pin of 8051 to 5V and leave it like that even after we are done with programming. Now onto your computer,

Summary

8051 = Arduino Uno

Vcc = +5V

GND = GND

Reset (Pin 9) = Pin 10

MOSI (Pin 6) = Pin 11

MISO (Pin 7) = Pin 12

SCK (Pin 8) = Pin 13

Step 3: Setting Up Files and Program

First of all, you need to install Arduino IDE, You can download it from Arduino.cc for free or contribute some amount. Now open it up go to

File>Examples>ArduinoISP and open it,

Now select the board as Arduino UNO and select the comport for me its COM6 and also Make a note of that we will need it later and upload the code to your board.

Now you need these two files one of them is a configuration file and the other one is this Text file with the command we need to upload the Hex file on our 8051. You can find the download from below

Now copy this config file and just paste it in your C drive over here else it won't work, Now open the text file and copy the command, Now open CMD and paste the line we just copied.

Step 4: Programming 8051

"C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude.exe" -C C:/AVR8051.conf -c stk500v1 -P COM5 -p 89s52/1 -b 19200 -U flash:w:"PATH":a

Over here if you look closely first is the path of avr dude in Arduino IDE, and thennext is the path of configuration file we just pasted in our C drive. Over here just change the comport to the one where you have connected your Arduino that’s why I told you to make a note of that so For me its COM6, after which here you will see 89S52/1 now since I’m using 89S52 I’ll change it to that but if you happen to use 89S51 just change it to that.

And finally you are supposed put the path of you hex file along with the name of file, So here below I have attached some Example hex file I have already created, anyways right click on the file go-to properties and from here copy the path and paste it here, now go back and copy the name of file with extension once done over here just put a backslash and paste the name of the file with the extension.

Now all we have to do is hit enter and you are done! You will see lights of Arduino blink and then stop and when you connect and LED to your 8051 it will blink which means coding was successful

Example Hex files are attached below,

Step 5: You Are Done!

So that's pretty much it for this tutorial guys, If you like my work consider checking out my YouTube channel for more awesome stuff: https://www.youtube.com/c/NematicsLab

You can also follow me on Facebook, Twitter, etc for upcoming projects

https://www.facebook.com/NematicsLab/

https://www.instagram.com/NematicsLab/

https://twitter.com/NematicsLab