Intel 8052
What is it?
A page dedicated to the Intel 8052 micro-controller and it descendants like the AT89S52 and CH559. But the information on this page can in most cases also be used for its relatives the 8051, 8031 and 8032Credits
A lot of the knowledge I write here is gained with the help of GertK. What I will write about SPI is purely based on hardware develloped by Gert. You can find him and me on this thread of the VCF-forum.Background
The 8052 is part of the MCS-51 family. It is not a processor but a microcontroller. A microcontroller can be considered as a small computer inside a single IC. Inside this IC you will find a CPU, ROM, RAM and I/O. Most probably a microcontroller is taking care of your keyboard: it reads the keys and sends the code for a pressed key to the computer.The BASIC version
Intel produced a Basic version for the 8052: 8052AH-BASIC. I learned to work with the it in 1986. In june 2025 I found the original IC I used that time and decided to pay some more attention to it again. Remark: it only works if at least 4 KB of external RAM is provided.Description of the 8052
The Wikipedia article gives an excelent description of the 8052 so, if you haven't had a look at it, do it now.Boards / projects
How does the 8052 work? The best way to explain it is to show you real examples in the form of small projects. Projects you can build yourself. Schematics are given in most cases.Aliexpress board
This boars is sold on Aliexpress . The advantage of this board: cheap. Remark: it only works with stand-alone 8051s, 8052s and equivalents. So the 8052AH-BASIC won't work stand-alone. But see later...
A disadvantage of this board is that, when using a laptop or PC without COM-port, one needs two USB ports to operate it: one for an USB-RS232 interface and one for providing the power.
Remark: remove the the MAX232 and replace it with a socket with wires attached to an USB-TTL interface and you only need one USB port.
The site of the seller also provided a schematic. Here is my Eagle version.
The file simple_test.asm contains a simple program that will blink the LED at output P1.7.
For more info, please check SBC-Aliexpress.htm.
BASIC-52 Executor
It found this board after resceiving the Gerber files. The site is in Japanese so you have to translate the various pages. I already noticed some information was missing so I decided to publice the most important files for it her as a backup:
the schematics
my Eagle version
I ordered five PCB at JCLPCB, gave two to friends and built a complete one. As 8052 I used a STC89C58 sold by Shotech, including BASIC V.132.
To operate it you need only one USB-TTL interface. These RS232 interfaces in general also provide power.
Aliexpress board + BASIC-52 Executor
I found out about the fact that BASIC-52 needs external RAM after I bought the Aliexpress board. That was the reason to buy the BASIC-52 Executor. Then I had this weird idea to piggyback the Aliexpress board on top of a BASIC-52 Executor PCB and it worked out fine!
An advantage of this combination: also only one USB port needed. But you have to remove the MAX232 first!
Shotech BASIC-52-PCB
I got this Shotech board for Christmas 2025. I got version 1. Version 2 and 3 only have an extra or bigger EEPROM and I have enough of them laying around. This board also included BASIC V1.32.
This board has an onboard USB-TTL serial converter and only a standard USB printer cable is needed to power the board up and provide communications. For more information, have a look at the schematics.
I have some ideas to use the now empty two sockets. Both are meant for EEPROMs like the 28C64. My idea is to use one socket for a static RAM and the other for a big FlashRAM like the AT29E040. The RAM can be written with data, be read as a datasource but also be read as a Program. That enables one to run programs from this RAM.
The extra address line inputs of the FlashRAM will be connected to free pins of port 1. This gives us access to max 512 KB of data.
For more info, please see Shotech.htm.
Running programs in RAM
Both the SBC-Aliexpress/Executor combination and the Shotech board have 32 KB of RAM but that RAM cannot be used to run binary programs, only BASIC programs. I already mentioned above that it is possible to do so with the RAM I wish yo add to the Shotech board, but how? The 8052 is based on Harvard architecture. Roughly it means seperate data and program memory. As a reference, your PC running Windows, Linux or MacOS uses the Von Neumann architecture: data and program can be mixed.The 8052 can run stand-alone but also in processor mode. In processor mode it has an address and data bus. Two complete ports and some pins of other port are used to generate the needed signals. The schematics of the Shotech board clearly shows what I mean: the right side of the 8052 shows the pins needed to create the conrol lines, the address and data bus. The left side show the free pins.
Pin P3.7.RD is used as the read signal and enables the 8052 to read memory with data. The PSEN pin enables the 8052 to read external memory with program code. Please have a look at the following schematic from the hand of Gert:
In this case Gert enables the last 8 KB of the installed 32 KB of RAM in the range 0000h..7FFFh to be used both as data and program memory using four NAND gates of one 74LS00 IC.
The Shotech board had in equivalent circuit, the four NAND gates in the top-right of the schematic: it enables any memory to be used for data as well as programs. The designers of this board meant this board to be equiped with EEPROM. EEPROM can be written but not as simple and fast as RAM. And that was the reason I decided to replace one EEPROM with a RAM.
I2C/H2>
Seen from the electronical point of view, I2C is very simple: two I/O pins with each a pull-up resistor, one for the data line SDA and one for the clock clock lin SCL, ground and power. For more information see this Wikipedia page.
The 8052 is also capable of handlig I2C. See the Shotech schematic: just top-left of the 8052 you see connector X3 with just right of it the markings SDA and SCL. In this case the lines are connected to the pins P1.5 and P1.6 but that is not standard. I found a paper from Microchip that explains how to connect a 8051 to I2C-EEPROMs and use the pins P1.2 and P1.3. 8052AH-BASIC version V1.32 supports I2C and uses the pins P1.5 and P1.6. The source code of V1.32 is available so there is IMHO no barrier to use other pins and compile a new version.
SPI/H2>
Having questions or comment? You want more information?
You can email me here.
You can email me here.