In alt.folklore.computers Lawrence D'Oliveiro <
ldo@nz.invalid> wrote:
On Tue, 22 Oct 2024 16:07:33 -0700, Peter Flass wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
>
On Tue, 22 Oct 2024 09:59:31 -0700, John Ames wrote:
Which, sure, beefy microcontrollers with comparatively spacious memory
loadouts are cheaper than ever, but less luxurious ones are cheaper
still - and a byte saved is, as always, a byte earned ;)
How much of your time did it take to save that byte?
Think of how many bytes you would need to save per hour of your time,
to make it worthwhile to whoever is paying for that time.
If it’s the difference between using what you have and buying a more
expensive board, times however-many units you’re shipping, it might not
be too many.
Presumably there is some threshold below which it simply isn’t worth
trying to save a bit of RAM. What is it nowadays: as much as 1MiB? Higher?
Lower?
It seems that you do not know what you are talking about. Most
embedded systems are small single chip ones. Smallest chips
on the market are something like 64 bytes of RAM and 1 kB flash.
IMO those make sense if you have simple problem which fits
without making special effort (or maybe you have huge volume).
If you are using Micro-Python your program, however simple
will not fit into such chip. Forth _may_ fit but you need
to make effort to get small version of Forth. Next interesting
point are chips with 2-4 kB RAM and 16kB flash. Those are
popular chips availale for 10-30 cents in quantity and few
times more in small volume. For hobbists interesting point
is STM32F103C8T6. It has 20 kB RAM and 64 kB flash. Boards
with this chip (or chinese clones of it) are available at
aroud $2 from chinese sellers. This is cheap enough to put
such board as part of a design and handling such board is
much easier than building own circuit with the chip. There
are bigger chips, but tendency is for much higher price
when you need more RAM. In classic MCU-s 1MB of RAM means
_very_ big and expensive chip. This is mainly because
MCU normally need logic parts (like processor core), analog
circuits (ADC-s and/or comparators), static RAM and flash.
Apparently it is tricky to get all of those into a single
process and bigger static RAM tends to take a lot of chip
area. There are now new "chips" which use multi-die
technology. For example RP2040 has flash on separate die
allowing much larger RAM compared to single die version.
Once you want more than 1MB RAM it makes sense to use exteral
RAM. And for larger amount one probably would prefer DRAM.
If you use DRAM, then smallest sensible amount is probably
16 MB. There is a chip on the market containing 1GHz core
and 64MB DRAM (this probably is two-die chip). One can
get boards with this chip at about twice of cost of
RP2040 board. Note that RP2040 has its own flash, while
the board with bigger chip needs extra flash or SD-card.
SD-card adds cost and at least cheap SD-cards tends to
be unreliable, so you may be pushed to more expensive
technology like eMMC.
Beside cost of the MCU chip there is also board cost. Small
chips can be put on simple cheap boards. More advanced chips
tends to require more advanced boards which may be more expensive,
especially in small quantities.
Concerning two-die chips, they are attractive for low-cost
gadgets, but may be problematic in real-time context.
Namely, flash access in such chips is _much_ slower than
in single-die chips. This may be partially compensated
using caches, on average such chips perform quite well.
But worst case time may be many times longer than best
case and it gets much harder to provide any warranty on
execution time.
For embedded chips cost is not the only factor. Namely, many
embedded devices use battery power. More processor cycles
and more data read from RAM and flash means more power
drain. To have reasonable battery life one needs efficient
program and a small chip.
-- Waldek Hebisch