MCS BASIC-52 (also known as MCS-51 aka 8051/8052 basic)
Intel MCS-51 (aka 8051) was developed by Intel in 1980.
Somewhere around 1985 one of Intel engineers created a BASIC interpreter for this processor and the fun just started.
One of my boards with the absolute minimum configuration…
- Atmel 89C52 (8052 clone) burned with the MCS-51 Basic
- 62265 aka 32Kbytes memory. YES this is 32768 bytes of RAM
Connect the power, connect your serial, press space 2-3 times and the familiar basic prompt shows up
- PRINT MTOP: Printed the maximum available memory of the system (32768 bytes)
- The second is an Easter egg from the developer of the MCS-51 basic
I had bought The Microcontroller Idea Book as hardcopy in the past (which is now available also as a free pdf http://janaxelson.com/files/microcontroller_idea_book.pdf)
I decided to create a board based on the book, keeping all the naming the same including the component designators with 32K RAM and 32K NVRAM
Here you go: Beauty 🙂
ON boot remember to
Set MTOP to 32K
Locations 8000H through 800FH are used to save the baud rate information, plus configuration information
According to the manual
The PROG3 COMMAND functions the same way as the PROG1 COMMAND previously described, except that PROG3 also saves the system control value, MTOP, when it is evoked. During a RESET or power-up sequence MCS BASIC-52 will only clear the external data memory up to the MTOP value that was saved when the PROG3 COMMAND was evoked. This permits the user to “protect” regions of memory from being cleared during a RESET or power-up condition. In typical use, the PROG3 COMMAND assumes that the user is saving some critical information in some type of battery-backed- up or non-volatile memory and does not want this information to be destroyed during a RESET or power-up sequence.
MCS BASIC-52 sizes consecutative external memory locations from 0000H until a memory failure is detected. The sizing operation is performed simply by writing a 5AH to an external memory location, then testing the location. If the particular memory location passes this test, BASIC then writes a 00H to the location, then again, checks the location. MCS BASIC-52 only sizes the external memory from locations 0 through 0DFFFH. Memory locations 0E000H through 0FFFFH are reserved for user I/O and/or assembly language programs.
I suggest to clear the first 8192 bytes of NVRAM minus the basic variables that are saved from FPROG3
10 FOR I=8010H TO 9FFFH
30 NEXT I
- DC Jack, you need to connect under the board the pins 2-3 (otherwise GND is missing)
- RESET is not connect from U1A pin 2 to U9A pin 2
- C20 is close to the regulator
- Under the REG 7805 there are some vias, add some protection
- J4 label is reverse (WE/WP => correct WP/WE)
- NVRAM DS1230AB-70 has different orientation from the rest of the ICs
Last update: 07/03/2020