Yes.
> However at the most extreme end of the market (very high volume/very low
> retail price) every fraction of a cent still counts, and there is no
> thing like a "too small cost difference".
>
There is no extreme end where that is true - there is /always/ a
trade-off. Even for the most long-lived products, there are deadlines
and limits to development costs, and even the most mass-produced
products have limit production quantities in a given time period.
>> In a typical cheapo device (like those "amusing" birthday cards that
>> play a tune, or plastic giveaway toys with a kid's comic) the
>> peripherals like a timer or two and a DAC or PWM with amplifier cost a
>> lot more than the cpu core in terms of die space.
>
> It is true that for applications that must drive a relatively heavy load
> the output transistor(s) are relatively large. Also the bonding pads
> take up percentage wise quite a bit of space on a small die. However
> 4-bit microcontrollers tend to have very few peripherals. Timers and PWM
> circuitry typically do not require more die space than the core and the
> associated RAM and ROM memory. A DAC (whose resistor network would
> occupy quite a bit of die real-estate) is usually omitted as PWM is for
> those applications good enough.
Agreed - this will vary from application to application.
>
> Also those applications typically don't use the smaller, more advanced
> (& more expensive) processes. That means the core, ROM and RAM still
> takes up quite a bit of die space.
That will vary. Small mass-produced systems rarely need a lot of RAM,
but can find ROM useful (such as for storing those irritating tunes).
An electric toothbrush, of course, does not need much ROM or RAM.
Typically the choice of process will be determined by many factors,
including other electronics on the chip (radio senders will need finer
processes, power electronics will be best with more robust processes)
and factory capacity.
> Hence when every fraction of cent is
> relevant it still pays to have very low-end microcontroller that can do
> the job. Also for extremely low power applications (like clock,
> thermometer...etc.) a dedicated 4-bit processor can still have an edge
> compared to a more general purpose 8- or 32-bit processor.
>
These sorts of things are often done with dedicated devices that can
hardly be called a microcontroller.
> Sometimes you find 4-bit microcontrollers in places were you would not
> expect a microcontroller in the first place, like in my toothbrush.
> Given its functionality (on/off/charge) I'd expect a few discretes would
> suffice, yet apparently a 4-bit microcontroller was more economical, but
> something like a general purpose 8-pin PIC apparently too expensive.
There is a /huge/ gap between 4-bit microcontrollers and general purpose
off-the-shelf devices.
For the biggest quantity systems, you use a dedicated ASIC with a
microcontroller core. In some of these, you might still find 4-bit
cores - but I think it is rare, because the die area cost difference
between a 4-bit core and an 8-bit core is much smaller than it used to
be, while development times and time-to-market is more relevant than a
decade ago.
The next step down for not quite so big productions is to use ready-made
chips as bare die, rather than in a package. By that point, testing
costs for the die and mounting costs are getting more relevant.
And by the time you get to pre-packaged devices, the cost of a small
8-bit core is irrelevant.
Even when you are talking about very large quantities, fractions of a
cent spared here and there often don't amount to real savings. A
slightly better core might mean extra features, or shorter development
and prototyping time, or shorter production test times, or more re-use
of parts or code.
But all this is speculation on my part - I have no experience with large
production quantities. At my company, we only have a few products at
more than 10K boards per year - most are smaller runs than that.
>
>> But you are right that these cores may be a more limited than even
>> an ATTiny - though some of them are /exactly/ as limited as ATTiny's,
>> as a major part of Atmel's business is ASICs with these kinds of
>> cores. And in these sorts of devices, I think you'd be surprised at
>> the amount of memory or other peripherals. It is not uncommon to
>> have quite a bit of ROM - far more than the flash sizes of an
>> off-the-shelf ATTiny.
>
> Once we are talking about more than a few kilobytes of memory, we are no
> longer talking about a market that is targeted by the bottom-end
> microcontrollers that may only cost a few cents.
>
>> But it will be masked ROM, not OTP - the programming time for
>> writing an OTP and the electronics for making the high voltages would
>> be far too expensive.
>>
>> The last 4-bit microcontroller family that was available to mere
>> mortals was from Atmel - I've forgotten the name of it.
>
> Atmel is/was hardly the benchmark for the very low-end & cost sensitive
> market. The 8-bit AVRs are relatively expensive. They are popular in the
> hobbyist scene due to the easy availability of the chips, tools &
> documentation and more recently the Arduino kits, but you don't find
> 8-bit AVRs that often in high volume products.
You are thinking of the Atmel products available to general customers.
A great deal more AVR cores are sold in ASICs than in off-the-shelf
microcontrollers. In fact, the off-the-shelf AVRs were started almost
as a side line to the main business of ASICs as someone thought that by
adding a few extra peripherals and better documentation they could sell
it to a wider audience with higher profit margins.
But you are right that AVR's are not very low end - as I said, Atmel
made a series of 4-bit microcontrollers too. The MARC4 devices were
targeted at infrared controls and wireless tyre pressure gauges amongst
other things. I have no idea how these compare to others in price -
they were just somewhat different in being available to mere mortals.
> At the real bottom end of
> the microcontroller market you find different players than the familiar
> players of the higher end microcontrollers (like Microchip, ST,
> Freescale....etc.).
Yes indeed - few people will have heard of them. However, even folks
like ST and Freescale make cores, ASICs, and dedicated chips for mass
productions. I read somewhere that the great majority of Coldfire cores
(Coldfire is the successor to the M68K family - certainly not low-end)
were in dedicated chips for single customers, rather than in readily
available processors and microcontrollers.
>
> Either way for C++ this has little to no relevance. If I were to write a
> general purpose C++ library these days, I wouldn't be too bothered how
> well it would do on anything less than a contemporary 32-bit processor.
> Given how the market is developing even the 16-bit microcontroller
> families like the PIC24 and MSP430 don't appear to have a very bright
> future ahead of them.
>
The msp430 is still a fine choice in some areas. But I agree with you
here - it is not at all unreasonable to assume 32-bit for C++ libraries.