[Andrew] picked up a handful of these big STC 8051 chips for a song and dance. The problem he has with them is the clunky VB6 programming software that only wants to run on a Windows box. He buckled down and wrote his own programming software called stcdude. As you have probably guessed, it’s meant to perform the same open-source functions that avrdude does for AVR chips. It can be used in conjunction with the Small Device C Compiler (SDCC).
It uses an API which is based on Lua script. We think this is to make it easy to interface your own hardware programmer with the software. The package is still quite early in development but it is working and even implements the ability to poll and identify the type of chip based on its stored hardware database. It sounds like he could use a hand. The stock software must still be used for setting the MCU options. We’re not really familiar with the 8051 family but we’d bet that is akin to setting the fuses on the AVR chips. Please let us know in the comments if we’re wrong about that.
the 8051 uses SFRs to change device settings, unlike avr, most all 8051 derivatives reset the SFRs at powerup.
Excellent news. I agree, these STC 8051 chips are a very good value (“dirt cheap” on ebay etc.). While the 8051 architecture is indeed “classic” I find it is pretty easy to work with and these modern “1T” versions have updated features and are 8-12 times as efficient per clock as the classic parts. So at 35Mhz (rated speed) these have quite good performance. I think they can make a reasonable and cost effective alternative to other 8-bit PIC and AVR parts for many projects (especially when MCU cost is a factor). They have a range of chips from 8 to 44 pins, but the “higher end” 40 pin DIP part I am using (see http://www.stcmicro.com/datasheet/stc12c5a60s2-en.pdf ) runs at 35Mhz with 1280 bytes RAM, 62K flash, ~40 GPIO, 4 timers, 2 UARTs, PWM, ADC, SPI, internal RC oscillator, external memory etc. for ~$1.90 qty 10). I find SDCC to be an easy to use C compiler and it works nicely with these STC chips (and includes a STC header file defining additional registers). Just like the author, I found the Windows VB6 ISP upload utility to be the main “hiccup” for smooth development (since SDCC is open source). Hardware-wise all you need is TTL serial to program the chips (like any FTDI adapter/cable). I have mine setup on a breadboard so it “auto-resets” like an Arduino when I rebuild (my code reads DTS via GPIO and automatically enters ISP mode) and it has been quite pleasant to develop for. I currently have it bit-banging a VGA 16-color tile-map and sprites for a little “retro game console” project. :)
Hey Xark,
Did you find the part you mentioned for $1.90 each when buying 10 or $1.90 for 10? If so, where!?!?! That’d be a helluva deal.
i learnt to program asm for 8051’s about 13 years ago. I have some old projects with 8051 derivative’s in them lying around with serial boot loaders, lcd routines etc.. i should read the roms back one day.
i miss the accumulator sometimes :( We’re all spoiled with C nowdays (arduino)
You miss messing with accumulators because you don’t have to use them anymore. Try again and you will soon switch back to C.
Wow, thanks for featuring this on HaD.
Yes, mcu options here play just about the same role as avr fuses. The only thing is that few can really brick it.
No dedicated hardware required, any usb serial dongle would do.
Regarding lua – it’s a bit different. I have all the lowlevel stuff in C, lua only serves as high-level glue and as a configuration format to store mcu database.That was done, so that it would be easier to experiment on the protocol and adopt for different protocolversions
i am currently using 51’s from silicon labs, there is no built in boot loader but the debugger is only $30 thier ide is free and works under wine with the older serial debuggers(have not tried the usb under wine in ages)
many of silabs chips will operate at up to 100MIPS but all but 2 devices are smd only, the f330 and f300 are hard to get in pth. but if you get a hold of some save them for breadboarding.
sdcc is available for both win and penguin.
Now all Andrew needs to pick up is a way to cut boards straight. Man when I was 12 I cut boards better than that!
I didn’t cut :) I was away from the proper equipment, so I just broke it off. For this project – I could care less.
Ragged board edges are a pet peeve of mine. It doesn’t take a lot of equipment to cut thin sheet neatly. I do it with a straight edge and a utility knife.
When I have to cut thicker sheet then I use some power equipment myself, even if it isn’t always the proper equipment. This clamp is made out of phenolic sheet, it is a bit too thick to just break off though.
http://i.imgur.com/dHlY6.jpg
Plus it has to fit well where it goes:
http://i.imgur.com/zWNB9.jpg
Makes me care.
I usually use a cutoff disk and a bit of sandpaper when I need fine edges. Not this time though.
A rotary cut off disc? Not to say that I haven’t tried it myself in the past but a straight edge and a knife work better for me. I have cut off discs up to 14 inches in diameter too.