Close
0%
0%

Single Chip Computer

Simple Single Chip Computer running MCS BASIC-52 with wireless connectivity between PC or Phone. No external crystal, latch or RAM required!

Public Chat
Similar projects worth following
Intel 8052AH-BASIC microcontroller requires additional external LATCH and atleast 1KB external RAM along with external crystal or oscillator to function as a stand alone computer running BASIC-52.
But after few decades now we can run true Single Chip Computer using just a 8051 core controller with internal RAM and internal oscillator with extended FLASH memory.
No external device programmers required to program the FLASH memory.
Running BASIC-52 V1.31 along with I2C functions and SFR Read/Write functions included.
Enhanced 8051 core performs 8~15 times faster than conventional core.
We can fit everything into a small DIP-40 form factor board which enables plug and play replacement for the conventional microcontroller board.

OBJECTIVE:

The objective of the project is very simple. Make a Single Chip Computer running BASIC-52 using enhanced 8051 core. The board form factor should be equal and compatible with existing DIP-40 600 mils package. The available pins should be mapped to the original DIP-40 package pinout.

The circuit should be very minimal. If possible run with only a single chip. 

PROs:

  • Single chip solution without any external components.
  • No external address latch
  • No external RAM required. Uses internal RAM for BASIC and program
  • No external Crystal or Oscillator required. Running at 24MHz internal oscillator
  • No external programmer required. Programming via USB or UART
  • PORT1, Tx, Rx, Timer, Interrupt, pins available for user interface!
  • Runs 8~15 times faster than conventional controller

CONs:

  • Limited Memory
  • No external memory 

We can easily overcome the limitations using CH558 or CH559 controllers. Using CH558/CH559 controllers gives the speed advantage of 2x since running at 48MHz. CH559 comes with 6kB RAM which is good enough for most of the programming needs.

The following description shows how we can implement a BASIC-52 single chip computer using CH552  IC. CH552E comes with MSOP-10 package. It is just 3x3mm size. But the number of useful I/O pins are just 4.  CH552G comes in SOP16 package. It has more I/O pins compared to CH552E. Same thing applicable to CH552P IC.  CH552T comes in TSSOP-20 package. It is having 20 pins and having highest pin counts in the CH552 family. CH552 family comes with 16kB FLASH and 1288 bytes Data Flash or RAM.

CH552E does not have UART0 pins mapped to physical IC. So we need to reassign the UART0 traffic to UART1 in the source code. 

The souce code was modified by Twitter(X) user @hiyodori5 

You can also find CH552E, CH559 code in his Twitter feeds.  CH559 code also supports SPI bus apart from I2C bus.

CH552 Block Diagram
Block Diagram

CONSTRUCTION:

If you just want to run the BASIC-52 on single chip, you can use any of the commerical available boards which using CH552E, CH552G, CH552P or CH552T.  We can also run the CH559 code on CH559 eval or dev boards.

The above image shows the board form factor and pin assignment.  Since the board was made in DIP-40 size and pins compatible with the original pinout of the 8052 IC. The board is very simple and can be fabricated on two layers. The fabricated board looks like below.

Power supply pins are VCC at pin 40 and GND at pin 20. PORT1 pins 0~7 available which is very useful for interface. Port 1 pin 2 also serves as PWM output which is useful to make any PWM based control or just create some noise or sound using buzzer/speaker.  Hardware Reset pin is available. RxD and TxD pins available for primary communication. INT0, INT1 pins are available. T0, T1 pins are available. P3.6 and P3.7 pins are available.  P3.6 and P3.7 are useful for programming the device Flash memory. 

We need VUSB capacitor and proper supply decoupling for reliable flash programming through USB port.  After programming BASIC-52 code, since we are not going to use the USB port anymore, we don't require the VUSB capacitor. By this way we can achive the real 100% Single Chip Computer using BASIC-52.  The Flash programming cycle endures for around 200 times.  Since we are going to flash only once, we need not to bother about flash programming anymore.

Since there is lot of space and no other components required, I don't want to go for fabrication with no other features. So I have decided to add onboard USB-TTL converter.  We can directly connect the Single Chip Computer to PC using 4 connections VCC, GND, D- & D+ pins.

The assembled and firmware loaded board looks like below. 

Both top and bottom side view. In the top side only one chip needs to be assembled. Bottom side there is no components needed for wired and wireless operation. There is a optional...

Read more »

ideabook.zip

BASIC-52 program listing The Microcontroller Idea Book Circuits, Programs, & Applications featuring the 8052-BASIC Microcontroller by Jan Axelson

Zip Archive - 21.52 kB - 03/26/2024 at 15:45

Download

microcontroller_idea_book.pdf

The Microcontroller Idea Book Circuits, Programs, & Applications featuring the 8052-BASIC Microcontroller by Jan Axelson

Adobe Portable Document Format - 1.32 MB - 03/26/2024 at 15:44

Preview

270010-003_MCS_BASIC-52_Users_Manual_Nov1986.pdf

MCS BASIC-52 Users Manual 270010-003 Nov 1986

Adobe Portable Document Format - 16.33 MB - 03/26/2024 at 15:29

Preview

MCS_BASIC52.pdf

MCS BASIC-52 ORERATING AND REFERENCE MANUAL V1.0 & V1.1 INTEL CORPORATION 1986

Adobe Portable Document Format - 776.74 kB - 03/26/2024 at 15:20

Preview

Intel_80C52_DS.pdf

Intel 80C52 datasheet 87C52/80C52/80C32 Preliminary

Adobe Portable Document Format - 250.38 kB - 03/26/2024 at 15:16

Preview

View all 7 files

  • 1
    SOURCE CODE

    First we need to download the source code from HERE

    You can find assembly language files along with hex and lst files.  

    If you want to modify anyting then you need to use the assembler .

  • 2
    ASSEMBLER

    I have used the C51ASM assembler for Windows from Microchip from HERE

    C51ASM is a 2 pass assembler same as metalink and produces same checksum without any errors or warning.

  • 3
    WCHISPTool

    To program the hex file into the FLASH of the target microcontroller, we need the WCHISPToolwhich is available .

    We can easily program using USB port which supplies VCC, GND and D+ and D-

View all 3 instructions

Enjoy this project?

Share

Discussions

WestfW wrote 08/26/2024 at 06:17 point

Do you know if anyone is working on adding USB (CDC) support to Basic52 instead of (or in addition to) UART?  There ought to be enough space...

  Are you sure? yes | no

Stewart Russell wrote 08/10/2024 at 19:43 point

Thanks: I get the "*MCS-BASIC-52 V1.31*" prompt on reset, but keyboard input still isn't happening with the Weact Studios board. I've tried various power options, and I get the same every time.

I have a couple of home-made CH552G 'ch55sxduino' boards  I can try.

Do you plan to make your PCB design available? It might be nice to try it with a CH559

  Are you sure? yes | no

mit41301 wrote 08/11/2024 at 05:24 point

I have tested CH552E, CH552G & CH552T  single chip computer using different types of USB-TTL  based on CH340, CP2102, FTDI 232 using WINDOWS 10 with Tera Term program. 

All the combinations worked fine. 

CH558 or CH559 boards easily available online. 

  Are you sure? yes | no

Stewart Russell wrote 08/06/2024 at 14:12 point

Thanks for writing up this project!

I tried this (basic52s) with the WeAct Studios CH552 breakout. It has 20 pins that mirror the CH552T pinout. I get the BASIC-52 prompt over serial but no keyboard input appears. I tried two different usb serial adapters and the txd line from the computer has continuity with the rxd pin on the ch552.

Am I missing something? Power is 5 V from the usb board

  Are you sure? yes | no

mit41301 wrote 08/07/2024 at 06:13 point

Make sure your baudrate is 19200. Other baud rates are not supported. 

After connecting with single chip computer,  hit the space bar followed by ENTER key few times. 

It should work without any issues. 

Type ?mtop or?xtal to get the response. 

If you are using serial terminal utility for downloading files into single chip computer,  provide 5ms delay between characters and 50ms between the lines for proper download. 

  Are you sure? yes | no

mit41301 wrote 08/07/2024 at 06:18 point

After establish the connection at 19200 baud, if you activate the hardware reset, you will see the BASIC-52 message with version number. 

  Are you sure? yes | no

mit41301 wrote 08/11/2024 at 12:11 point

Make sure the board operating at 5 Volts and USB-TTL also operates at 5 volts and NOT at 3.3 Volts. 

I have checked the WeAct CH552T circuit and found that the board operating at 5V and there is a default external clock oscillator running at 24MHz. 

There are jumpers to disconnect the oscillator. 

There is a LED connected with a series resistance sharing the same Rx pin of CH552T. 

  Are you sure? yes | no

Stewart Russell wrote 4 days ago point

I finally got a working board! I found I had some "CH55XG v1.1 - designed by cqmcu" boards I bought some years ago. These have a USB mini-B connector, but no external xtal or LED on any serial line. They program and run quite well. So thank you so much for your project writeup!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates