• Please review our updated Terms and Rules here

8051/8052 SBC

Yes, I found it as well this afternoon but time played tricks with me. In time I really thought that it was connected to the the 8052-BASIC board directly but this controller board is needed as well :(

These LCD's need a constant flow of data and clock signals (heavily multiplexed) otherwise they will suffer from DC bias deterioration. The controller chip takes care of that but the overall circuit was quite complex with some RAM, ROM, latches/buffers as I recall.
I do have the datasheets of the LCD screen, LM-40001G, and I wonder if a modern micro-controller could handle it, like the CH559 I mentioned earlier.

I have made a start with getting the schematic for my 8 bit parallel bus to SPI interface into KiCad.....
I'm looking forward to it.
 
Is there a way to read the contents of the internal ROM of a 8052 or compatible?
1. If the chip is already running MCS-BASIC, or a Forth, then you can do it from within the language - for example, MCS-BASIC has the CBY() function which returns the contents of a given code memory address.

2. If it's running some other code from Internal memory, then it depends...

2a. Some manufacturers, for example STC micro, don't provide any (documented) method of reading the internal Flash memory. The built-in ICSP routines only support writing to the flash. There are a few option bits, for example setting the running speed, which are read/write via the ICSP.

2b. Many manufacturers have 'lock bits' protecting the Flash memory - for example Atmel, now Microchip, devices have these. Whoever programmed the device will have chosen how to set the lock bits - so you may be able to read back the Flash memory if the lock bits weren't set.

3. Generally chips with an actual ROM built in, rather than Flash or EEPROM, won't have any method for an end user to read or write to the code space.
 
Some of these later 805x are protected against reading from the outside. Even if they have the /EA pin you can not simply switch back to internal rom (by changing the state of the /EA pin) after startup as the state of the pin is latched during powerup. :-(
 
Is it possible to toggle the signal telling the CPU that you have external ROM for each memory fetch cycle? If so you could feed it a load immediate instruction and toggle that signal when it's about to fetch the immediate value, and then end up with something from the built in ROM in a register.
Or maybe it latches the external ROM signal at reset and doesn't let you toggle it this way?
 
STC claim that not being able to read the contents of the Flash memory is a security feature. The STC 15 used in that retro game controller can't address external memory in the normal 8051 way, at all.

Even the STC chips that do support external memory (the STC89 range) don't usually have working /PSEN and /EA pins, so won't run code from external memory. They can only read/write external memory via the MOVX instruction, and the MOVC instruction only addresses internal Flash. The rare 'HC' and 'HD' versions of the STC89 do have working /PSEN and /EA pins, but you can never find anyone selling them (most sell the '90' version, which has two extra GPIO pins in place of /EA and/PSEN).

I don't think there's any way you can read the Flash memory, even on those STC89 'HC' / 'HD' versions, and certainly not on the STC15, STC12 and STC8 chips. That's unless there is some secret way of doing it - but the chips have been around for ages, and I would expect that any such secret methods would have leaked and become public knowledge by now.
 

I got BASIC-52 running on the Silicon Labs C8051F340 chip. So far, just using internal RAM (4kB). Next I plan to add 64 kB of external RAM, and then modify the built-in EEPROM programming routines to use the chip's self-programmable flash memory (it has 64 kB of that). Looks promising.
 

I got BASIC-52 running on the Silicon Labs C8051F340 chip. So far, just using internal RAM (4kB). Next I plan to add 64 kB of external RAM, and then modify the built-in EEPROM programming routines to use the chip's self-programmable flash memory (it has 64 kB of that). Looks promising.
Indeed, quite a quick performer. With onboard SPI you can also easily attach more modern peripherals like LCD or SD-cards.
 
First results with my experimental SPI hardware on the ILI9488 320x480 color LCD.
Too bad you can not force the display in 16 bit per pixel mode using SPI, now I have to send 3 bytes per pixel...
SPI hardware runs at about 1.5 MHz clock (using ALE frequency divided by two as SPI clock now) which can be improved.
Here using a fixed 256 color palette preset in ROM.
 

Attachments

  • 2025-12-16 21.45.30-1.jpg
    2025-12-16 21.45.30-1.jpg
    779 KB · Views: 6
Some more functionality and SPI speed added (SPI clock is now at 8 MHz). I can also set full RGB color with a COLOR r,g,b command.

With a 6x10 font installed I now have 53x48 (tiny) characters. In Landscape mode this would result in 80x32 characters.

With this default portrait screen orientation I can use hardware vertical scroll built into the ILI9488 controller. Alas the ILI9488 does not support hardware horizontal (landscape mode) scroll :-( And scrolling 480x320x3 bytes is not doable in reasonable speed on the 8052, not even on the 8052 @ 32 MHz :-) Clear screen takes about 1 second now.

2025-12-20 17.05.36-1.jpg

Code:
10 rem shade sphere
100 string 200,50:cls
220 locate 8,35:color 0,255,0
230 $(1)="Sphere in MCS-52 Basic, (C)2025 by KGE"
240 for t=1 to 38
250 display asc($(1),t)     
260 next
510 R = 100:R2 = R * R
515 W=320:H=480
520 X0=W/2:Y0=H/2
540 For Y = -R To R
550  For X = -R To R
560   D2 = X * X + Y * Y
570   If D2 > R2 Then 610
580     C = Sqr(R2 - D2) - ( X + Y) / 2 + 130
590     Color 0,C,C
600    Plot X + X0, Y + Y0
610  Next
620 Next
 
The Silicon Labs chips, C8051F340 and C8051F380, can address external ram, and don't even need a latch chip to do it. If you don't use a latch chip, it ties up three of the five ports, (P2 and P3 for the address bus, P4 for the data bus). You can choose to multiplex 8 of the address lines with the data bus, which frees up a port, but slows down ram access.

The chips can't (as far as I know) address external code space, but that doesn't really matter because they have 64 kB of self-programmable flash memory that you can write to using movx opcodes, after twiddling a couple of SFRs to temporarily disable the code memory protection.

You can also set some bits that prevent any program from self-writing to a specified range of flash memory, so you can protect the first 16 kB (say) of flash to hold the BASIC-52 'rom', and no runaway program can ever erase that part - you need an external programmer to switch off the protection.

I think the BASIC-52 PROG and ROM instructions require modification, as I think they rely on the same memory being addressable as both code and xdata? It looks to me as though BASIC always expects to fetch its tokenised program from xdata memory, so the Silicon Labs chip ROM command will need to copy from code to ram before a rom-stored basic program can be executed. I'm working on that now.

Runs very fast - 48 MHz clock, with most opcodes executing in just one or two clock cycles. The chip has 4 kB ram on board, so you can run BASIC with no external chips, at all, providing you don't need much ram. You still have the 64 kB flash, so your machine code routines called from BASIC can be pretty huge.

Dev boards available at AIi Express and on eBay. The 380 version looks attractive, because it has an SD card slot on board, but it also uses a proper RS232 connector for the default com port - so you need an external RS232 adapter. The 340 version has a built-in USB-to-serial chip so is a bit neater.
 
I was given this nice 8052 board as a present for Christmas. The site comes with schematics and other documentations. The German document lead me to this site: https://www.elektrik-trick.de/archiv.htm. I haven't studied the Shotech board that well but it could be that it is based on this 8052-ECB board. Even when it isn't, this page seems very interesting as well. Have fun!

Oh, and Merry Christmas!
 
I was given this nice 8052 board as a present for Christmas. The site comes with schematics and other documentations. The German document lead me to this site: https://www.elektrik-trick.de/archiv.htm. I haven't studied the Shotech board that well but it could be that it is based on this 8052-ECB board. Even when it isn't, this page seems very interesting as well. Have fun!

Oh, and Merry Christmas!
Looks like a nice solid board, I thought it looked a bit familiar but seeing the Elrad article I knew it for sure: I have read about this board before :-)

Do you have the assembler rom (or rom image) too?
 
Dev boards available at AIi Express and on eBay. The 380 version looks attractive, because it has an SD card slot on board, but it also uses a proper RS232 connector for the default com port - so you need an external RS232 adapter. The 340 version has a built-in USB-to-serial chip so is a bit neater.
I have ordered the F380 version just to tinker with :cool:
 
There are also the C8051F120 development boards. They cost around twice as much, but the C8051F120 can clock twice as fast (100 MHz) and has 8kB of on chip SRAM instead of 4KB, and 128kB of on chip Flash.
 
Looks like a nice solid board, I thought it looked a bit familiar but seeing the Elrad article I knew it for sure: I have read about this board before :-)
The Shotech board is not the same as the 8052-ECB board. The last has a GAL onboard, the Shotech one hasn't.

Do you have the assembler rom (or rom image) too?
What assembler ROM? I bought the cheapest board for the simple reason that the 2nd board had an extra 8 KB EEPROM and the 3rd one comes with a 32 KB one instead of the original 8 KB one; parts that I already have. I also haven't seen "assembler ROM" mentioned anywhere. The article even says: "EEPROM wird gelöscht geliefert." = "EEPROM will be delivered erased".
Also take in mind that V1.32 has more commands than the original V1.1 and V1.2 versions.
 
Back
Top