PROGRAMMING AT89S52 USING ARDUINO

Introduction: PROGRAMMING AT89S52 USING ARDUINO

In-System Programming (ISP) aka In-Circuit Serial Programming (ICSP) is the ability of some programmable logic devices, microcontrollers, and other embedded devices to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system.

In this tutorial the AT89S52 microcontroller is programmed by using Arduino as an In-Circuit Serial Programmer.

Supplies:

1x AT89S52
2x 33pF Disc Capacitors
1x 11.0592MHz Crystal Oscillator
1x 0.1uF Capacitor
1x 10kOhm Resistor
1x Push Button
1x Bread Board
Jumper Wires - as Required

Teacher Notes

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

Step 1: CIRCUIT CONNECTIONS

Connect the components in a breadboard as shown in the figure.

*Note: pin 31 should be pulled to +5v since we're using internal program memory.

Step 2: CONVERTING ARDUINO INTO ISP

1. Connect the Arduino to PC.
2. Select the appropriate board and the port.
3. Upload the code from the file attached below.

Now the arduino is ready for programming 89S52 microcontroller.

Note* Don't remove the USB cable from PC to Arduino after uploading this arduino code.

Step 3: CREATING HEX FILE

1. Open the Keil uVision software.
2. Type the program and save it as .c file.
3. Double click on 'Source Group ' and click on the .c file you created.
4. Right click on 'Target 1'.
5. Set the Crystal frequency as 11.0592MHz.
6. Check 'Use On-chip ROM'
7. Click on 'Output' tab then check the 'Create HEX file' and click OK

Step 4: PROGRAMMING AT89S52

1. Open the 89S52 programmer software in your PC.

2. Select the COM port in which the Arduino is connected.

3. Click Identify. This will result in a message saying 'atmel AT89S52 detected'.

4. Click Open hex file and select the hex file.

5. Click upload. It will write the hex file into the microcontroller.

6. It's finished. Now you can upload any code to the 89S52 by using Arduino by following this tutorial.

Be the First to Share

    Recommendations

    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    6 Discussions

    0
    tytower
    tytower

    7 weeks ago

    I'm just wondering what this program does loaded behind the arduino ".ino" file .
    What skullduggery are you up to ?


    {
    "folders": [
    {
    "name": "Microkeyring",
    "path": "."
    }
    ],
    "settings": {
    "terminal.integrated.env.linux": {
    "PATH": "/home/acala/.platformio/penv/bin:/home/acala/.platformio/penv:/home/acala/bin:/home/acala/.local/bin:~/scripts/:/media/acala/NETAC128/safe/scripts/:/home/acala/bin:/home/acala/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games",
    "PLATFORMIO_CALLER": "vscode"
    }
    }
    }

    And what is the "ebutton " program all about too?

    0
    tytower
    tytower

    3 months ago

    Linux users forget it . Its a windows only thing.

    0
    tytower
    tytower

    3 months ago

    There does not seem to be any code to make the hex file from? There's a couple of png shots of board and circuit but an exe file you have to trust and run? I don't think so mate.

    0
    tytower
    tytower

    3 months ago

    So if the chip is in a circuit inside a device how do you change the code on the chip in situ? Whats needed to do that?