← Back to context

Comment by anonli

8 days ago

At $0.20 in 1k quantities, this is TI's answer to the CH32V003, Puya PY32, and the STM32C0 series. It's great to see tier-1 silicon vendors participating in the race to the bottom for jellybean microcontrollers.

The 1KB of SRAM is admittedly very tight (even WCH's 10-cent RISC-V parts usually give you 2KB), so you are strictly in bare-metal, carefully-managing-your-stack territory.

1KB isn't so bad unless you are making something complicated or need large buffers. You can do quite a bit of nontrivial stuff with it. Years ago I made universal remote with ATtiny13 + external EEPROM for storing remote data. It has only 64 bytes of RAM, that's what I would call very tight. Was still able to program it in C, 1KB flash and number of pins were bigger limiting factor than ram.

Plenty of DIY projects used ATtiny2313 with V-USB. That's a pure software USB implementation bit banging the IO pins (not a USB stack on top of hardware USB support)+ your application logic squeezed into 2K of flash + 128 bytes of ram.

Chips like this are great for digital glue logic. Read a sensor, read a button press, blink some LEDs with simple state machine or control loop.

  • It's been long enough ago that I don't use it as an interview answer anymore, but one of the most interesting things I built (technique-wise) was a Z-80 based serial multiplexer with no RAM. The only volatile memory it used was the device registers. The fun part was handling subroutine calls without a stack. The Z-80 has an indexed jump mode, so before calling a subroutine, I'd fill the jump register with the statement after the subroutine call, and when the subroutine was done, execute the jump with the (return) address prefilled.

    Anything to save a few bucks on a 6264 SRAM component :-)

  • Yes, that's "bare metal" as opposed to programming in MicroPython, Javascript with Espruino, Lua/NodeMCU, Rust, or adding your C application on top of an off-the-shelf RTOS.

    C support is basically universal these days, very few chips require you to program in only assembly anymore.

    • I had no troubles targeting an ATTiny13A with Rust.

      (had to disable debug symbols, though)

      Why should that be any harder than C?