Breaks can get interesting when you have a FIFO'd UART, and a UART error interrupt. I don't recall the CPU but I've seen a situation where the error int happens when the UART is still in the FIFO behind some data.
This caused an issue only with DMX coming from I think a Pharos unit, which sent the break immediately after the last byte of the previous frame.
Silicon Labs gives away full versions of Keil's C51 compiler when you install their free Eclipse-based IDE, Simplicity Studio. And, it's completely cross-platform
Of course, Cortex-M0 parts that cost the same have come in and wrecked both of these in terms of raw processing performance and nJ-per-sample power consumption figures (but not power consumption in wait/sleep modes!)Also cortex M at such price don't have such interesting peripherals. For example, with EFM8UB1 I can get MCU with crystal-less USB, 5V tolerant GPIO, internal 3.3V voltage regulator which can supply up to 100 mA to external devices and 12 bit ADC for around $0.60 @100pcs. That is pretty amazing.
Does the SI license say you can use the compiler they provide on other vendors' chips, or are you just engaging in a subtle form of piracy?
Of course, Cortex-M0 parts that cost the same have come in and wrecked both of these in terms of raw processing performance and nJ-per-sample power consumption figures (but not power consumption in wait/sleep modes!)Also cortex M at such price don't have such interesting peripherals. For example, with EFM8UB1 I can get MCU with crystal-less USB, 5V tolerant GPIO, internal 3.3V voltage regulator which can supply up to 100 mA to external devices and 12 bit ADC for around $0.60 @100pcs. That is pretty amazing.
Look at STM32F042.
In general, I feel like I have a much better idea about what a "typical" $1 microcontroller will do...
"do you get 5x or 10x the capabilities with a $5 or $10 microcontroller?" (and a comparison at the $15 level (near the top-of-the-line for AVRs) is a lot more dramatic in some ways. The 8bit chips are about 256k flash and 8k of RAM, while the 32bit chips are up at 1MB flash and 256k of RAM!)
Look at STM32F042.Well, I looked on it briefly . Costs more than twice as much. No internal 5V -> 3.3V regulator, ADC capable inputs are not 5V tolerant. To use it with USB, instead of just a few decoupling caps I would need to use external VREG. ADC is much less versatile, no analog gain adjustment (0.5/1). Only single 1.25V reference voltage (1.65V and 2.4V for UB1). No analog comparator, UB1 has 2 of them, no internal DAC (used with comparators, both inverting and non-inverting inputs). UB1 comparator also has programmable hysteresis.
Look at STM32F042.Well, I looked on it briefly . Costs more than twice as much. No internal 5V -> 3.3V regulator, ADC capable inputs are not 5V tolerant. To use it with USB, instead of just a few decoupling caps I would need to use external VREG. ADC is much less versatile, no analog gain adjustment (0.5/1). Only single 1.25V reference voltage (1.65V and 2.4V for UB1). No analog comparator, UB1 has 2 of them, no internal DAC (used with comparators, both inverting and non-inverting inputs). UB1 comparator also has programmable hysteresis.On the bang-for-your-buck metric, you ain't gonna beat an EFM8UB1. For typical USB full-speed devices, it's nearly perfect.
You have good intuition about that? I don't — and I think a lot of people don't, either. There's a lot of opinions floating around, but not a lot of facts.
- Is a 24 MHz Cortex-M0 is faster or more efficient than a same-price 72 MHz 8051?
- Does PIC's super-high clock rate + low-power make it comparable to the more-efficient-clock-cycle AVR? Better? Worse?
- I know code density is worse on Cortex-M0 chips, but how much worse? What happens when you factor in all the manufacturer-supplied peripheral libraries?
- Are 16-bit MCUs a "sweet spot" between the 8-bit and 32-bit guys, or just a waste of time? What about weird 16/8-bit hybrids, like the Renesas RL78 that has 8-bit data paths, but a 16-bit ALU?
- Honestly, is there even a reason to mess with 8- and 16-bit MCUs? Should everyone just use Cortex-M0s for low-end stuff?
- Which manufacturers have the best IDEs? Code-gen tools? Peripheral libraries?
Try running some C code that uses the full power of the language - lots of structure manipulation, and so on - and 8051 code from the best compilers looks pretty bad. So, speed depends a lot on the kind of code you are running
A real 12-cycle 8051 core is always pretty slow. With a modern single cycle 8051 core code that's heavy in bit banging can be really fast and dense. However, the code looks slower and more bloated as the complexity of the code increases. Try running some C code that uses the full power of the language - lots of structure manipulation, and so on - and 8051 code from the best compilers looks pretty bad. So, speed depends a lot on the kind of code you are running.
The PIC is largely in the same category as the 8051, with regard to what it does well and does poorly. The AVR runs most complex C code pretty well.
If you think M0 code is less dense, that might reflect the kind of code you have been looking at. Try some serious maths, and the M0 code should look far denser than any PIC or 8051 code. Pretty much anything using the real power of the 32 ALU should result in denser code.
One 16 bit core which does hit a sweet spot is the MSP430. It does pretty well on bit banging. It does pretty well on compute. C compiles very well for it. I have seen people get pretty good results with some RL78 devices running full featured C code, but I don't have personal experience.
On the bang-for-your-buck metric, you ain't gonna beat an EFM8UB1. For typical USB full-speed devices, it's nearly perfect.
Maybe from the buck point, otherwise no, nope. But it is interesting MCU.
What I do not understand is the price point the 32F042 is usually sold at 1-off quantities at the usual distributors. As I do know for what price it is usually sold at quantities (not that large), it is kind of mind boggling. (but not only with this one)
I was obviously referring to the modern, 1T 8051 cores on my list, like the three-stage pipelined EFM8 ones Silicon Labs makes. The Nuvoton N76 in my lineup is also a 1T 8051, but its instruction timing is quite a bit slower on critical instructions than the EFM8 stuff.
Do you have suggestions/recommendations for what, specifically, to run to illustrate this "complex C code"? As far as I understand, struct manipulation is the same thing to a compiler as array manipulation with immediate (const) offsets. Neither the 8051 or AVR has load/store instructions that take an immediate-offset parameter (IIRC? Correct me if I'm wrong!), which means they will perform similarly in this regard (8051 will be a cycle faster than AVR if the data is in RAM, and a cycle slower than the AVR if the data is in XRAM).
Sure, obviously, but we're talking about microcontrollers, not GPUs. I'd say that most MCUs I program don't sit around in for() loops running filters all the time.
Totally agree; I had my first experience with the RL78 a few weeks ago, and I really, really enjoy working on it. And unlike the MSP430, it's priced to compete with 8-bit MCUs.
Not all 1T 8051 cores are created equal, but the big deal is usually the memory controller. You can be sure the flash isn't keeping up with a 72MHz core. There is no cache to mask that slowness, so the cleverness of the flash controller can be a big deal in extracting good performance.
The only rule is that the part has to be $1 or less @ 100 units from reputable sourcesQuote from: YansiLook at STM32F042.
Well, I looked on it briefly ... No internal 5V -> 3.3V regulator, ADC capable inputs are not 5V tolerant. To use it with USB, instead of just a few decoupling caps I would need to use external VREG. ADC is much less versatile, no analog gain adjustment (0.5/1). Only single 1.25V reference voltage (1.65V and 2.4V for UB1). No analog comparator, UB1 has 2 of them, no internal DAC (used with comparators, both inverting and non-inverting inputs).
The review will include quantitative comparisons between feature sets, benchmarking (via a 16-bit biquad filter test measuring kSPS and nJ/sample), power analysis, plus more qualitative stuff (development environment, SDKs, compiler choices, development/debugging experience, etc)...
The only rule is that the part has to be $1 or less @ 100 units from reputable sourcesQuote from: YansiLook at STM32F042.
Well, I looked on it briefly ... No internal 5V -> 3.3V regulator, ADC capable inputs are not 5V tolerant. To use it with USB, instead of just a few decoupling caps I would need to use external VREG. ADC is much less versatile, no analog gain adjustment (0.5/1). Only single 1.25V reference voltage (1.65V and 2.4V for UB1). No analog comparator, UB1 has 2 of them, no internal DAC (used with comparators, both inverting and non-inverting inputs).Changing the rules?
That particular chip might be out of your (arbitrary) price range, but now you are adding even more limitations.
The industry is moving away from 5V, and many 3.3V MCUs are not 5V tolerant on analog inputs - for obvious reasons.
Peripherals you don't need are just a waste of silicon and raise the price for no good reason.
Changing the rules?
That particular chip might be out of your (arbitrary) price range, but now you are adding even more limitations. The industry is moving away from 5V, and many 3.3V MCUs are not 5V tolerant on analog inputs - for obvious reasons. Peripherals you don't need are just a waste of silicon and raise the price for no good reason.
A fair comparison would take months if not years, by which time your 'review' will be way out of date.
It sounds like you have some specific applications in mind. If so then you should make a short list of chips that have the features you need, choose one, and see if it will do the job.
But if you are just trying to organize a 'shootout' to see which MCU is 'best' then don't bother - unless you have a lot of time to waste.
Quoteand a comparison at the $15 level is a lot more dramatic in some ways.... once you compare the base members, you're good.
None of the 8-bit PIC architecture chips can address more than 4k of RAM.
One of the important factors, even when considered a $1 chip, is the potential for transitioning to a more powerful chip without having to start over.
For <1$ you've absolutely got to add the Nordic Semi NRF51 to the list
Below that what's fascinating is the STM8S003F3P6 which is the cheapest microcontroller I've been able to find and pretty nice for that (already discussed in this thread). It's <0.2$ which opens up a whole other range of opportunities.
For <1$ you've absolutely got to add the Nordic Semi NRF51 to the listGreat chip, but totally, definitely, not even close to being <=$1.
(snip)