Author Topic: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...  (Read 19125 times)

0 Members and 1 Guest are viewing this topic.

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #25 on: November 16, 2022, 09:22:12 pm »
Quote
Quote
Or that what avr-g++ implements is "real C++")
Why on Earth not? What do you/they think is missing?
Exceptions.  STL.  Lib-g++.  "new"

(there was a "not everyone" in the original sentence, right?  Personally, I'm quite willing to separate the libraries from "The Language" and hunt around for the "modified" STL modules that might actually be convenient, if I really need them.  But I'm sure I can find C++ programmers who will tell me that I'm not really programming in C++, I'm "just using C with Classes")
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1473
  • Country: au
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #26 on: November 16, 2022, 09:43:26 pm »

All 8051's since the original intel release, have multiple register banks, (4) and 2 bits in the PSW select the bank.
Intel did a revision to support 4 interrupt priority levels, up from 2, and that has propagated into many/most new designs too.
1T 8051's are by far the most common new devices in 2022, and 6T parts are very much NRND and EOL.

I am surprised to see how far ago these design root from, most likely very different to today's iterations.
It might be about giving solutions people were already used to.
Yes, legacy is both a blessing and a curse.  8)
It shows how software costs can dominate a projects costs.


Quote
1T 8051's are by far the most common new devices in 2022
Who cares about "new devices"? 
Umm, people doing new designs ?  8)
New devices also show where the MCU vendors are putting their money.

Quote
(Microchip, for example, sells a whole range of 8051 chips that they've acquired via corporate acquisitions.  12T, 6T, 1T...  Lots of choices.  But I don't think they're doing any "new" 8051 chips.

Correct, Atmel released the AT89LP series which were 1T parts but they did not survive the Microchip take over, which saw Microchip have too many MCUs .....
AT89LP parts are still  used in production, but I'd tag them NRND as there are 'better alternatives'

Quote
Quote
1T 8051's are by far the most common new devices in 2022
My impression is that the vast majority of 8051-architecture chips sold these days are actually Asian System-on-Chip things like MP3 players, or Mouse controllers, or flash memory controllers, or ... etc.  Or "legacy" chips that aren't new at all
'sold' is always hard to quantify, especially on custom parts,  but there is a lot of new device activity on 8051 cores.

SiLabs has recently released their EFM8BB52, which are wide Vcc 5V operating with on chip regulators.  ( 8 bit AVR's have only just caught up to on-chip regulators)

There is a lot of activity around what I'd call a 'new 20 pin pinout standard', which was pioneered by the STM8S003, and you now see a lot of '003' pin compatible parts with 8051/ARM/RiscV cores
Typically those families have 002/003/004/005 etc in the part number.

The STM8S003 parts were very cheap in asia, some years back, but then the price shot up, and second sourcing became important.

A quick check at LCSC shows the STM8S003 still well stocked, but at a premium price (100+ US$1.2075)  over Nuvoton, Holychip, SinOne, RunJet, Fuman, OnBright, LnChip etc pin compatible alternatives.


« Last Edit: November 16, 2022, 09:46:22 pm by PCB.Wiz »
 

Offline josuahTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: fr
    • josuah.net
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #27 on: November 17, 2022, 06:42:58 pm »
"just using C with Classes"
I am happy with C, but when pushed toward C++, I like "C with Classes" better.
Or rather writing a C library, and wrapping it with a C++ interface.
It helps me to check if a bug is related to the data processing, or the abstraction on top of it.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #28 on: November 17, 2022, 07:37:12 pm »
... when pushed toward C++ ...

What is pushing you towards C++?
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14297
  • Country: fr
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #29 on: November 17, 2022, 07:38:28 pm »
... when pushed toward C++ ...

What is pushing you towards C++?

The wind? ;D
 

Offline josuahTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: fr
    • josuah.net
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #30 on: November 17, 2022, 08:03:02 pm »
The project I need to work on, or tool I need to debug.

For instance, YoSys is a bit closer to C, and Verilator is really C+++++
 

Offline josuahTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: fr
    • josuah.net
 

Offline Sniper1

  • Regular Contributor
  • *
  • Posts: 76
  • Country: ro
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #32 on: November 27, 2022, 05:42:33 pm »
Someone mentioned  AVRs with PIC periferical s.
Can anyone give me some examples, i am curious and want to see what would be new/better then lets say an atmega328?
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #33 on: November 27, 2022, 07:35:38 pm »
Quote
what would be new/better then lets say an atmega328?

Presumably the AVR-Dx families, and perhaps including Mega0 (ATmega4809) Tiny-0, Tiny-1, and Tiny-2

AVR-DB, for example:

Quote
The AVR® DB family of microcontrollers feature the well-known AVR® CPU, now running at up to 24 MHz across the full supply voltage range of 1.8V to 5.5V. The family includes 32 KB, 64 KB, and 128 KB Flash variants in 28- to 64-pin package options. The AVR® DB family is designed to bring analog signal conditioning, real-time control, and multi-voltage operation to applications including industrial control, home appliance products, automotive, and Internet of Things (IoT).

The family uses the latest Core Independent Peripherals with low-power features and 5V operation for increased noise immunity. The Analog Signal Conditioning (ASC) module includes three OPAMPs, which can form gain stages and filter functions allowing signal conditioning with down to zero external components. The Multi-Voltage I/O system allows safe bi-directional communication with systems running at a different voltage. The Event System, Configurable Custom Logic (CCL), along with intelligent analog peripherals like 12-bit differential ADC, Zero-Cross Detect (ZCD), 10-bit DAC together with the ASC and MVIO makes the AVR® DB family well suited for sensor applications, IoT end nodes and other applications where signal conditioning or level-shifting is needed.

 

Offline MadScientist

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: 00
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #34 on: November 27, 2022, 07:48:21 pm »
I think AVR is one of the best with a huge range of products , great support , nice architecture , good tools and a big community
EE's: We use silicon to make things  smaller!
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14297
  • Country: fr
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #35 on: November 27, 2022, 07:48:57 pm »
Someone mentioned  AVRs with PIC periferical s.
Can anyone give me some examples, i am curious and want to see what would be new/better then lets say an atmega328?

Not sure what the question entails exactly. A generic answer would be: almost any MCU available at the moment if it wasn't designed 25+ years ago.
 

Offline Picuino

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: 00
    • Picuino web
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #36 on: November 27, 2022, 10:01:09 pm »
Someone mentioned  AVRs with PIC periferical s.
Can anyone give me some examples, i am curious and want to see what would be new/better then lets say an atmega328?

I mentioned it.

For example the CTMU module:
https://www.microchip.com/stellent/groups/SiteComm_sg/documents/DeviceDoc/en542792.pdf

Or the Configurable Logic Cells:
https://ww1.microchip.com/downloads/en/DeviceDoc/40002188A.pdf

Numerically Controlled Oscillator:
https://ww1.microchip.com/downloads/en/Appnotes/90003131A.pdf

And so on.

https://microchipdeveloper.com/8bit:peripherals
« Last Edit: November 27, 2022, 10:03:36 pm by Picuino »
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #37 on: November 27, 2022, 10:14:49 pm »
Someone mentioned  AVRs with PIC periferical s.
Can anyone give me some examples, i am curious and want to see what would be new/better then lets say an atmega328?

Not sure what the question entails exactly. A generic answer would be: almost any MCU available at the moment if it wasn't designed 25+ years ago.
IMHO nowadays you should go for a microcontroller which has a continuous memory space of at least 64kB. The 8051 and PIC with seperate memories are great to program in assembly but a C compiler chokes on them. These architectures simply don't support pointers. Keil and IAR got really clever but if you are not carefull, your code will be slow so even though you might be programming these in C, it is with your arm tied behind your back and the code isn't portable to any other architecture.

I don't know about AVR but the MSP430 with it's 16 bit architecture is pretty good and very low power.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #38 on: November 27, 2022, 11:42:30 pm »
IMHO nowadays you should go for a microcontroller which has a continuous memory space of at least 64kB.

You should go for a microcontroller which is suitable for your project. That's how it's always been, that's how it is, and that's how it will be until the end of Humanity.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1473
  • Country: au
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #39 on: November 27, 2022, 11:58:30 pm »
 
IMHO nowadays you should go for a microcontroller which has a continuous memory space of at least 64kB. The 8051 and PIC with seperate memories are great to program in assembly but a C compiler chokes on them.
That's too general a claim. Plenty of MCU tasks need nowhere near 64k.

What is happening in the general small MCU space, is the 'smallest code' parts are slowly getting larger, as process changes ripple through.
Two decades ago, there used to be 1k and 2k code size variants of small MCUs.

Fast forward to 2022, and the smallest new MCUs released tend to be 8k or 16k code, they simply do not bother with less code size.
eg I see a roadmap for a 2mm x 2mm 8 bit MCU where the smallest code size is 16k
 
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #40 on: November 28, 2022, 12:01:55 am »
IMHO nowadays you should go for a microcontroller which has a continuous memory space of at least 64kB.

You should go for a microcontroller which is suitable for your project. That's how it's always been, that's how it is, and that's how it will be until the end of Humanity.
Yes, and NRE for microcontrollers with a crappy CPU core is extremely high. Development time is hard to predict due to all the detours you need to take in order to write the firmware. And you'll need specialist software engineers as well which cost a ton of money. So yes, a microcontroller with a continuous memory space is the best choice if you want to get a product out on time without breaking the bank.

@PCB.Wiz: It is not about the amount of memory, but the ability to write C in a normal way so code can be re-used regardless the platform (instead of having glorrified assembly disguised as C). Nowadays one of the biggest assets of companies that develop electronics is their software library and the ability to keep reaping the benefits from code that has been written before. I have been doing embedded software development for a while and I have managed to get quite a few projects simply due to the fact that I have a broad library of software that runs on almost every platform as long as it supports pointers. That gets me and my customers ahead of the competition because I can keep development time & NRE costs low.
« Last Edit: November 28, 2022, 12:31:40 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1473
  • Country: au
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #41 on: November 28, 2022, 12:34:47 am »
@PCB.Wiz: It is not about the amount of memory, but the ability to write C in a normal way so code can be re-used regardless the platform. Nowadays one of the biggest assets of companies that develop electronics is their software library and the ability to keep reaping the benefits from code that has been written before. I have been doing embedded software development for a while and I have managed to get quite a few projects simply due to the fact that I have a broad library of software that runs on almost every platform as long as it supports pointers. That gets me and my customers ahead of the competition because I can keep development time & NRE costs low.

The largest impediment to portable MCU code, is not the compiler, but the peripherals.
It sounds like your working space, is quite some distance from the Tiny MCU's mentioned in this thread title.
Over the years, we did many MCU projects in Assembler, and HLL, and had zero need to port to another MCU. Sometimes we upgraded to newer variants.

We did a few projects where we supported multiple vendors, of the same multisource cores, from a single HEX file so it did not matter which MCU products used.
For those, pointers was never a question, it was the peripherals that were the main issue, and usually we could find some SFR pattern that was unique to each vendor.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #42 on: November 28, 2022, 12:46:09 am »
Quote
Fast forward to 2022, and the smallest new MCUs released tend to be 8k or 16k code
The new AVRs include Tiny-0 and Tiny-1 parts with as little as 2k of code memory (8 and 14 pin packages.)  But they're generally not any cheaper than the 4k versions.

But I do remember when I bought some ATmega48 chips as "the big chips with lots of memory!"  (4k instead of 1k/2k)
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #43 on: November 28, 2022, 12:58:06 am »
@PCB.Wiz: It is not about the amount of memory, but the ability to write C in a normal way so code can be re-used regardless the platform. Nowadays one of the biggest assets of companies that develop electronics is their software library and the ability to keep reaping the benefits from code that has been written before. I have been doing embedded software development for a while and I have managed to get quite a few projects simply due to the fact that I have a broad library of software that runs on almost every platform as long as it supports pointers. That gets me and my customers ahead of the competition because I can keep development time & NRE costs low.

The largest impediment to portable MCU code, is not the compiler, but the peripherals.
It sounds like your working space, is quite some distance from the Tiny MCU's mentioned in this thread title.
Not necessarily. I have some super lightweight APIs that are very easy to adapt to different peripherals. From there I can copy & paste in things like dealing with external I2C, SPI devices like ADCs, memories. Also UART handling and text processing, etc. Most of it originates from 8051 / MSP430 projects.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #44 on: November 28, 2022, 01:50:54 am »
IMHO nowadays you should go for a microcontroller which has a continuous memory space of at least 64kB.

You should go for a microcontroller which is suitable for your project. That's how it's always been, that's how it is, and that's how it will be until the end of Humanity.
Yes, and NRE for microcontrollers with a crappy CPU core is extremely high.

Are you suggesting that all MCUs with under 64 KBytes ROM have crappy CPU cores?
 

Offline bson

  • Supporter
  • ****
  • Posts: 2265
  • Country: us
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #45 on: November 28, 2022, 03:41:42 am »
Many old designs are rubbish, but some ideas have stood the test of time.
Most curiously, the VAX was also loosely based on the PDP-11 (orthogonal src/dst, register file, addr modes) but turned out to be rubbish.  The microcoded design just couldn't be scaled, and DEC couldn't throw real estate at the problem the way Intel did a couple of decades later with the x86.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1473
  • Country: au
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #46 on: November 28, 2022, 03:58:44 am »
Quote
Fast forward to 2022, and the smallest new MCUs released tend to be 8k or 16k code
The new AVRs include Tiny-0 and Tiny-1 parts with as little as 2k of code memory (8 and 14 pin packages.)  But they're generally not any cheaper than the 4k versions.
Yes, but Microchip are more unusual in generating a lot of part numbers from one die.
The Tiny-0 series derives from a 16k part, that they also release at 8k/4k/2k in the 14 pin version.
Likewise the newer AVR-DD series is 64k down to 16k, in 14 pin packages, so you can see the lower code sizes simply falling off the table.

Other vendors are moving to fewer derived part numbers, which I agree with, as it avoids distributor dilution effects..
« Last Edit: November 28, 2022, 08:37:27 am by PCB.Wiz »
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3996
  • Country: nz
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #47 on: November 28, 2022, 04:51:28 am »
Many old designs are rubbish, but some ideas have stood the test of time.
Most curiously, the VAX was also loosely based on the PDP-11 (orthogonal src/dst, register file, addr modes) but turned out to be rubbish.  The microcoded design just couldn't be scaled, and DEC couldn't throw real estate at the problem the way Intel did a couple of decades later with the x86.

That's not what it was about.

The VAX was designed with two main goals:

1) support a flat 32 bit address space with page-based virtual memory

2) allow assembly-language programmers to write programs using fewer lines of code (fewer instructions), in the belief that the main productivity driver.

The VAX was to solve the "software crisis", in which computer hardware was getting exponentially cheaper while programmers were getting more expensive, and as computers got cheaper more sites bought them and they all needed more and more custom software.

DEC knew full well that the VAX 11/780 would be a little slower than a PDP 11/70 on software that fit on a PDP 11, but it DIDN'T MATTER because the machines were going to be so much cheaper (certainly by the time they got to the 2nd or 3rd model) so the customer could just buy several of them if necessary. And VAX code would get written so much more quickly with the more expressive instruction set and without the 64 KB memory limit.


As for Intel throwing silicon at the problem, that is true to a certain extent, but *both* PDP11 and VAX have fundamental problems that make them less able to use advanced implementation techniques than x86. Except for a couple of weird cases such as MOVSB, x86 instructions only ever have one memory operand and -- more importantly -- that operand only accesses one memory address.

VAX has up to six or so memory operands (with three being extremely common). PDP-11 only has two. But that is still much worse than one.

And even PDP-11 has addressing modes that load something from memory and then use the thing just loaded as a pointer to load or store the actual data somewhere completely different in memory.

You can split up these multiple operands and complex addressing modes into µops, but the *problem* is that a single instruction can cause four different TLB misses / page faults on the PDP-11 and dozens on the VAX, and this makes it really really hard to save pipeline state, call an OS handler to fix everything up, and return to the right part of the instruction that had the problem.

x86 only ever accesses one memory address with one instruction, making things much much simpler.

In fact x86 can get two page faults from a single instruction if the data being accessed is misaligned AND crosses a 4K page boundary. But this is both extremely rare AND something that the page fault handler can detect, and fix up both adjacent pages at the same time before returning.  And just retry the whole instruction again from the start.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #48 on: November 28, 2022, 07:38:01 am »
Quote
[new avrs include] Tiny-0, Tiny-1, and Tiny-2
hackaday just linked this nice summary of the new Tiny chips: http://www.technoblogy.com/show?3UKF

 
The following users thanked this post: elecdonia, PCB.Wiz

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14072
  • Country: de
Re: Tiny MCU architectures: AVR, PIC, 8051, STM8, MSP430, custom RISC...
« Reply #49 on: November 28, 2022, 08:49:54 am »

IMHO nowadays you should go for a microcontroller which has a continuous memory space of at least 64kB. The 8051 and PIC with seperate memories are great to program in assembly but a C compiler chokes on them. These architectures simply don't support pointers. Keil and IAR got really clever but if you are not carefull, your code will be slow so even though you might be programming these in C, it is with your arm tied behind your back and the code isn't portable to any other architecture.

I don't know about AVR but the MSP430 with it's 16 bit architecture is pretty good and very low power.

The difficulty for the C compilers is not with the memory size, with µCs with a split adress range. This complicates things and one needs work arounds like seprate pointer types for ROM, RAM and IO.
Separate IO is a bit less critical. For 8 bit CPUs this usually means less than 64 kB of ROM to have RAM and ROM in the same 64 kB adress space.

Anyway for small programs code portability is not that much an issue.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf