Some months ago I came across an offer of 10 STC15F104W for about 30¢ each so I took the plunge. These are 1T 8051 MCUs with 4kB flash and 128B RAM. The only drawback is it is a DIP-8 or SOP-8 device so has only 6 I/O pins but this may be sufficient for small applications, and you can always extend the I/O with serial protocols.
The datasheet was easily found with a search and In System Programming only requires Tx/Rx pins, readily available from a USB to TTL converter. But being a lazy person I wondered if I could use my QX-mini51 development board since it already has the converter on board and I have already set up stcgal.
Looking at the pinout, besides the power pins, the 6 I/O pins are port 3.0 through 3.5 with P3.0 and P3.1 used for serial communications. I just needed an adaptor. I had some prototyping boards of the right size, so I soldered a DIP-8 socket and then wires to 8 pins taken from a broken precision (round pin) IC socket. I'm feeling chuffed about not throwing that away. I don't really need P3.2 to P3.5 but I wired them anyway. I soldered another pin at 21 for better registration. Here's the result:
BTW the datasheet suggests isolation diode and resistor to prevent powering the MCU from the USB serial adaptor. This is not necessary since there is only one power supply, that feeding the QX-mini51.
I connected up the board to the USB port, ran stcgal, pressed the power switch and got this:
$ stcgal Waiting for MCU, please cycle power: done Protocol detected: stc15 Target model: Name: STC15F104W Magic: F294 Code flash: 4.0 KB EEPROM flash: 1.0 KB Target frequency: 0.000 MHz Target BSL version: 7.2.5Q Target wakeup frequency: 35.650 KHz Target options: reset_pin_enabled=False clock_source=internal clock_gain=high watchdog_por_enabled=False watchdog_stop_idle=True watchdog_prescale=64 low_voltage_reset=False low_voltage_threshold=3 eeprom_lvd_inhibit=False eeprom_erase_enabled=True bsl_pindetect_enabled=False por_reset_delay=long rstout_por_state=high uart2_passthrough=False uart2_pin_mode=normal cpu_core_voltage=unknown Disconnected!
If you're wondering why the target frequency is 0, this MCU family has an onboard oscillator.
So now I have to think up of things to make with these tiny MCUs.