8052 processor IDE

8052

This is a page about my freeware 8051 / 8052 IDE program which is an editor / emulator / debugger / assembler / disassembler / ISP programmer for the 8052 all in one portable Windows executable. Many years ago when I was programming the 8052 professionally and at home, tools were very expensive. There was not much freeware or opensource, but trough my employer I had most of the tools I needed. I wrote a lot of programs in 8052 assembler in 8052 assembler and PL/M, but I also learned to write in C and I had a good C compiler for the 8052. The 8052 was a genius design for its time and its funny that this processor is still used a lot. For development and debugging 8052 assembler code, this freeware IDE can be used. Regards, Hein Pragt.

I also have a Facebook Group on Retro Computing and Electronics, feel free to join!

8052 editor / assembler / emulator / debugger

8052 Workbench

To be able to program for the 8052 you need an assembler or compiler. I personally still like to write in 8052 assembler but I could no longer find tools for Windows 10. There were still some programs to download but most of them worked at DOS level, had serious bugs or did not fit my needs. After some searching I decided that it was time for a new project, building a complete integrated 8052 development environment. I found a pretty good assembler and the base code of my Z80 IDE and I had some olde code in my code library. The result is 8052 workbench, a portable x64 Windows program that includes an editor, assembler, disassembler, emulator, single step debugger, Intel hex read / write function a VT100 terminal window, a seven segment display with 8 LEDs and keyboard support.

Installation

Download the zip file and unzip it at the place where you want to install it on your hard drive. Then create a shortcut to the program to the desktop and the program is ready for use. It is a so-called portable program which means that it does not use external sources or libraries and does not use the registry. After removing the directory from this program, it has also disappeared completely from your system.

First time use

To practice there is an example4.asm file in the example directory, which you can load after which it will be in the shown in the middle edit window. Now you can convert this into machine code by means of the assemble button, this will appear on the left of the screen and be put into the virtual memory of the emulator. The last (or first) .org statement will also be put in the program counter and by simply pressing the run button you can execute the program and follow it on the screen. This will not be very fast because every instruction will perform a screen update of all registers. If you want the program to run faster, you can disable the update of the registry block by means of the update checkbox. You can now modify the program, reassemble it and run it again.

In de example directory there are also two 8052 Basic versions from Intel that will run fine in this IDE emulator. After the assembler and RUN hit the spacebar (just as in the original autobaud detect) and the prompt will be shown.

There are more example files, a lot of them I made myself when testing the IDE and some I found on the Internet and are free to use.

By means of the step button you can execute the program instruction by instruction and check the output and the registers. You can also enter the break address, the emulator will then stop at a run command at this address and display the registers of that moment. When 0000 is entered in the break field it will be ignored.

You can save the modified code as an asm file again but also save it as a hex file so that you can load the binary code in a circuit or ep(rom) for a real 8052 circuit. You can also read an Intel-Hex file, which will then be loaded into the internal emulator memory. You can also run tis code when you put the correct start address in the program counter. You can also disassemble this internal emulator memory code after which the source code will appears in the edit screen in the middle. This can then be changed and written back into the emulator memory by means of assemble button.

I/O map

The 8052 has no I/O space so the LEDS and seven segment display are mapped on port 1 and 2. You can put the leds on port 1 or 2 and the display on lines port 1 or 2 and character port 1 of 2. You can select this with the top menu, or with some extra assembler directives I added. Look in the example files to see how they work.

  • The keyboard is send to the serial buffer of the 8052 (SBUF) and the display is also connected to the serial (SBUF) of the 8052. I also pulse the character on the RX pin to enable autobaud detect and simulate the hardware as good as possible.
  • Interrupt lines are connected to the interrupt buttons at the top of the screen, when pushed they will activate the interrupt lines.
  • The output ports are shown at the top as input values and output values, they can be modified to test input / output code.

LED I/O modes

In led I/O mode 1 the leds are connected to port 1 and a 1 on the port makes the led light up, directive is ;#LED1

8052 Leds Port1


In led I/O mode 2 the leds are connected to port 2 and a 1 on the port makes the led light up, directive is ;#LED2

8052 Leds Port2

Seven segment display modes

In Seven segment mode 1 the leds are connected to port 1 is select of segment and port 2 is display data. The data is latched so the displays keep their value even if they are no longer selected. Directive is ;#SEVEN12

8052 Seven1


In Seven segment mode 2 the leds are connected to port 2 is select of segment and port 1 is display data. The data is latched so the displays keep their value even if they are no longer selected. Directive is ;#SEVEN21

8052 Seven2

Interrupt pins configuration

The I0, I1 and I2 buttons ar the top of the screen are connected to the interrupt lines to simulate external interrupts.

8052 Interrupts Buttons

User define buttons configuration

There are also four user define buttons on the seven segment panel, these are connected to P1.2 to P1,5 to simulate external switches.

8052 User Buttons

Supported processors

The current version supports the Intel 8031, 8032, 8051, 8052 and Atmel 8952 processor. For the Atmel 8952 processor this IDE had a ISP In Circuit Programming mode, that supports a serial Arduino ISP module to update an 8952 processor from within the IDE. You can edit code, run and debug it on the emulator and then test it on a real 8952 processor. The hardware configuration of the IDE is equal to a cheap 8952 development board from China.

Supported development board

I use this development board, you can order it in my webshop, its very complete, you have to solder it yourself. It had a Zif socket for the processor, a full rs232 circuit, and USB circuit, four pushbuttons and a reset button, am ISP programming connector, eight output leds, a power supply, crystal in socket and all I/O lines on connector pins.

8952 Developme Board

Link: https://www.heinpragt.nl/?product=avr-development-board-kit

Schema of this development board

Development Avr51

8952 ISP programmer using Arduin nano

I created my own Arduino Nano based ISP programmer for the 89S52 processor. I connected it to the Chinese development board with a standard ISP connector cable and I guess this will work on other 8052 ISP development boards as well. I chose this development board because it is very cheap and has a lot of features. And of course an Arduino Nano is small and also cheap.

8959 Arduino Nano Isp

Schema of Arduino Nano ISP programmer

Arduino Nano 8952 Isp Schema

Download Arduino Nano sketch for the ISP programmer.

*) This will also work with an Arduino Uno board!

Version 1.04

I use the 8052_workbench myself and that is one of the way I find and fix bugs. One of the last things I did was recode de TB31.asm file, a complete Tiny Basic interpreter for the Intel 8031 and made it work fine on 8031 with 128 bytes internal ram. During this process I found some little bugs in de emulator and I added a mode to emulate a real 8031 (128 bytes memory checks) to the code. Also I fixed code that would destroy the user interface if there was too much output to the windows. And the most important new feature is the ISP In Circuit Programming option. The example directory now also contains the Intel 8052 floating point basic assembly sourcecode, the complete 8031 tiny basic assembly sourcecode and the paulmon21 assembly sourcecode. I proudly present version 1.04 of the 8052 developer IDE.

Download

Here you can download the latest version if this IDE. This download is a zip file containing a portable x64 (and a x32 version) Windows exe programs, an assembler directory and a examples directory. After weeks of debugging I think the project is ready for release, if you find any bugs please report them to me.

https://www.heinpragt.nl/?product=8052-processor-ide

  • Version 1.04
    • Added full timer 2 support.
    • Added ISP upload feature
    • Change Led polarity to match development board.
    • Added four buttons to LCD panel.
    • Fixed P3 display in register panel.
    • Fixed windows corrupt on to much update.
    • Fixed SETB to handle LEDS correct.
  • Version 1.03
    • Fixed error in IDE update windows that would destroy the IDE context menus.
    • Fixed ADDC flags error.
    • Fixed MOVC A,@A + PC instruction.
    • Fixed DA A instruction AC flag error.
    • Fixed SUBB OV flag error.
    • Added 8031 emulation checkbox.
  • Version 1.02
    • Fixed a last minute change error in the terminal code that made keyboard not respond.
    • Fixed the name of the example directory.
    • Fixed a unwanted quote character in exampkle4.asm.
  • Version 1.01
    • Initial release, it might be not completely bug free, I will test on, wait for remarks amd release the next version soon.


8052 links, tips and documents

More pages on software development

Leave a Reply

Your email address will not be published. Required fields are marked *