I’d somehow missed this, the 8051 being perhaps the 3rd CPU I got a little familiarity with - Intel (and second sources) offered the 8052 microcontroller with a built-in Basic. Apparently useful for fire alarms, burglar alarms and other kinds of not-realtime industrial control.
Some time in early 80-ies Intel produced a mask-programmed 8052 MCU which contained a floating-point Basic interpreter with lots of interesting features, including built-in support for EPROM storage of BASIC programs.
After building my first 8052-BASIC project I learned that there is more to that Basic that shows up on a surface. The most important fact is that it looks for extension ROMin code memory space and if couple of bytes check out during boot, tries to call initialization code and does other interesting things in that ROM space. So the method to map 32K of RAM to both code and data space is not a very good idea at all, possibly resulting a crash at startup…
Rather than hijack the PJRC 8051 dev board thread with something only marginally related, I think I’ve found a port of 8052-BASIC to the incredibly cheap CH552 8051 clone:
The thread is in Japanese, but there are working download links to a Google Drive folder with various hex files inside. I haven’t tried these yet, even though I have a bunch of the (5× for $10) WeAct Studio CH552 USB breakout boards.
The BASIC program seems to be limited to around 500 bytes as the CH552 isn’t configured with any external RAM.
Hi
I got Tiny BASIC working on the SAB80535 dev board although BASIC-52 also looks interesting and a lot more complete.
I did some searching with Google for BASIC-52 and there are many hits. What would be the best starting point so I can port over to my SAB80535 dev board project?
What assembler is necessary? I am using AS31 assembler and ASEM-51 macro assembler for project so far.
;*****************************************************************************
;* *
;* MCS-BASIC-52 V1.31 Source Listing *
;* 12/1986 till 11/2001 *
;* The original source code of V1.1 (BASIC.SRC and FP52.SRC) by *
;* Intel Corporation, Embedded Controller Operations *
;* is public donain *
;* *
;*****************************************************************************
;
;*****************************************************************************
;* General alterations made by D. Wulf, 12/1999. *
;* e-mail: Detlef.Wulf@onlinehome.de *
;*****************************************************************************
Hi
OK, that’s great. Good to start out on the right foot when doing new software ports so much appreciated.
When I ported the Tiny-BASIC on the PJRC website to my SAB80535 dev board, the defaults were to run in ROM and it took a while to find and adjust the settings so it would run properly in RAM.
I will download the BASIC-52 code and see if it runs on the SAB80535 dev board. Looks really interesting! Thanks, Andrew Lynch
The smallest/cheapest CH552 chip only has enough RAM for a roughly 600 byte program, but the CH559 has a more useful 6 KB of RAM. None of these chips can take external RAM, however, and it seems that programs don’t persist and must be ‘typed in’ via the UART
While the CH559 is available inexpensively as bare chips, the dev boards are much more expensive
It’s great to see people still interested in using early microcontrollers as the base for retrocomputing. I put Basic-52 v1.3 on an eprom to run on a New Micros SAB80535 board. Lots of fun still to be had. The 8051 series was kind of weird with a modified Harvard architecture that could be run as a von-Neuman processor out of common ram. I’m also seeing if I can use 68HC11 based boards to act as a 6800-based SWTPC clone due to the same instruction set and architecture. Maybe try to get VTL on it. Running the tools in dosbox adds to the fun.
I finally found an inexpensive CH552 board that would run this interpreter straight off. The board has silkscreen “CH55XG v1.1 - designed by cqmcu” and has a Mini-B USB port. The important detail is that it doesn’t have an external crystal.
The interpreter seems quite nippy. I wonder what I can do with roughly 500 bytes of program space?