If you're insisting on a full-speed internal clock, you're getting awfully judgmental, rather than the "quantitative review" you implied in your first message.

The reason the mega328 isn't in the review is that it's more than $1. It's amazing how much it's come down in price: microchipDIRECT has the 328pb — which I agree is a substantial upgrade to its predecessor — for $1.05. But that's still more than $1. You can make fun of me, but the problem is as soon a I say $1.05 is OK, then I'll be looking at some great NXP part that's just 10 cents more, and then I really ought to swap out that PIC16 for a PIC24, and... blah blah blah. Plus, it's way more fun to try to squeeze as much out of the parametric searches as possible :-)

As for "being picky" literally *every other* microcontroller that I'm reviewing operates at full speed on 3.3V from an internal oscillator. I don't think I've ever had to lay down a random 20 MHz crystal on a board to drive an MCU before in my life. It's just sort of a weird, foreign concept. Should I include the price of the crystal when talking about the MCU price? What about package dimensions? Small crystals are really expensive. Or do I just test the mega with its fastest internal oscillator, as this is the configuration that most designs will use? 16 MHz, I think?

Voltage is another problem. The device I use for measuring really accurate current consumption only outputs 3.3V, which literally every other MCU plays fine with. Do I cobble together some other way to accurately measure current consumption — just to test this single part? Do I test it at 3.3V, which, again, I assume most designs will be using? (I can't think of the last commercial product I've designed or torn down that had a 5V MCU in it). I don't know — I'm still thinking about how to review the tinyAVR1616, because it's got the same voltage issues.

I'd be willing to evaluate a megaAVR (as long as it's $1 or cheaper), but I'd like input from you on how you would go about working through that stuff. Also, if I'm already reviewing a tiny1616, what's the point? Is the development process different? Is the core performance going to be substantially different? (not rhetorical questions — seriously, let me know, as I'm not knowledgeable about AVR).

For testing, I'm essentially doing four things: First, I'll measure speed and power consumption while running a 64-sample array through a second-order high-pass filter implemented as a 16-bit signed direct form I biquad (to test math and memory speed). I'll do a simple LED toggle (to illustrate the instruction cycle / system clock / number of instructions relationships — more just for fun, as it's not a serious way of measuring overall system performance, but it gives the reader intuition about the how the architecture works). Finally, I'm going to implement a DMX-512 receiver that controls an RGB LED, and measure active power consumption (so I can get a feel for the platform's code-generation tools / peripheral libraries, and to measure power consumption in an environment where you can't actually sleep the MCU, and instead just halt it). I'll also put the chip in deep sleep with an RTC running (if the MCU has it), just to collect similar data across all platforms at the same voltage (which is the annoying part about comparing MCU power consumption from their datasheets).

Big winners will be efficient architectures that can do a lot of math quickly (as well as with low active power consumption), as well as architectures that have very low idle current, and architectures that have very low sleep current.

westfw wrote:

A 40pin DIP $1 processor is an "interesting" chip with a lot of potential applications, almost regardless of clock speed. (look at all of the <1 MIPS 8051 chips that are still being deployed...)

Yeah! I love playing around with that stuff. I found some original 8751s (basically, 8051s with EPROM — not EEPROM) on eBay and wrote up a post on my new blog about developing and programming them with current-generation tools (Silicon Labs Simplicity Studio, modern USB-based EPROM programmers, etc).

westfw wrote:

Which non-gcc compilers are you thinking of that meet those requirements?

I was referring to AVR-GCC, not GCC in general. So other platforms' GCC implementations (ARM, MSP430, RL78), along with other open-source compilers, like SDCC (which is finally starting to get decent at 8051 and STM8 code, though from what a friend tells me, still struggles to produce good PIC code — haven't verified myself).

But the other thing is this: if you're a student, hobbyist, or a professional looking to evaluate an MCU, I think you'll be fine with the free "limited" compilers — no matter which platform you're using (ok, except Microchip if you want any semblance of performance). I know you're going to criticize me for calling expensive, proprietary, limited compilers "free" but effectively, they are. (We're talking free-as-in-beer, not open-source).

Take CC-RL, Renesas's in-house compiler for the RL-78, which I've been playing around with all weekend for the review. It produces absolutely fantastic code. Yes, after 60 days, it goes into code-size-limited mode — but the limit is 128 KB of linked code. That's almost comically high. I don't know about you, but I've never used that much code on an 8-bit MCU before in my entire life, and probably never would.

A lot of these ARM MCUs on my list are pretty weak in terms of flash (the PSoC 4000S has 16K, but everything else is running 8). Need a good, efficient compiler for an 8 KB part? Go download a free version of MDK, which, by many measures is the absolute best ARM compiler for microcontrollers. It's code-size-limited to 32K, but who cares? If you're buying a 64K or a 128K part, you can probably switch back over to ARM-GCC and have enough headroom to lose a bit of efficiency.

Also, keep in mind that many semiconductor houses work with compiler vendors to provide free versions of them to their users. The best STM8 compiler on the planet, Cosmic, is now totally free and unrestricted. Silicon Labs gives away full versions of Keil C51 ​with Simplicity Studio and — you didn't hear it from me — it can be used to compile code for any 8051 (useful if you're a hobbyist and don't mind skirting under the EULA to squeeze in a bit of extra code).

The other thing is cross-platform support. I'm on Windows, but if I wasn't, I'd probably be much more comfortable with Silicon Labs or an ARM vendor, since they all provide officially supported macOS and Linux builds of their entire products. Sure, you can easily setup an AVR toolchain to build code on macOS or Linux, but with no IDE and no debugging support, it's not a viable option for the general professional market (we're lazy).

Holtek Semiconductor's HT66F0025 8-bit MCU is about $0.19 in 10K quantities programmed with your code, and placed in Reels. It's a few cents less if you simply order the Micros. The smaller HT66F002 is a couple cents less same quantity and programming and packaging.

I will throw some water onto the fire before it starts.

1) the IDE is over 12 years old, and is not digitally signed, and is clunky.

2) the ICE is primitive, but it does work. Once you order the special IC's for I.C.E....This reminded me of the old PODS from NOHAU with the "HOOKS MODE" or "BONDOUT MODE" micros on the PODS

3) the Datasheets are tough to understand due to the language barriers, but they are not horrible either compared to some datasheets I have read. It took a few reads, and some experimentation.

4) there is little to no support although the rep in the Americas office does a decent job trying to get answers.

You get what you pay for. But the micros do what they are advertised as.

It's by no means a speed demon, large flash, big SRAM et. al. but for super simple stuff, or a glue logic replacement they have their niche.

Jim

I would *love* to review a Holtek part. Part of my review is to illustrate the balance between subjective IDE metrics, raw performance, and price. For example, look at the STM8. STVD — the STM8 IDE — is... uhh, pretty basic. But ST-Link debuggers are $5 on eBay, and STM8 parts are 5 cents each on Taobao, and they're great little microcontrollers. They're also widely available in the U.S. of course. Arrow and Avnet have a bunch in the 35-cent range, and I think DigiKey even has some of the higher-end ones.

Anyway, back to Holtek: What do I need to get started? Could you send me any links to the IDE I need to download, or the debugger tool?

I looked at the HT66F0025, and it's... well, it's cute, but I wouldn't call it a general-purpose MCU.

Instead, I found a bunch of HT66F0185s on Taobao for 30 cents in single quantities. These guys are in a 28-pin SOP package with an integrated 16 MHz oscillator, 8K of flash (4K x 16), and 256 bytes of RAM, with 128 bytes of EEPROM. 8-channel, 12-bit ADC, UART/SPI/I2c. Three timer channels. Seems much more general-purpose to me.

You scared me with the datasheet comment, but I actually find the datasheet for this guy perfectly readable. Of course, I'll be regretting this comment when I start programming these chips and find a bunch of errors.

I always read the timers section of a datasheet first — if I can understand your MCU's timers, everything else is smooth sailing.

They guarantee a flash program memory retention of >10 years. Hey, at least they're not overselling this thing.

It looks like I'll need to actually buy the HT66V0185 emulator chips, and hook them up to an e-Link debugger. I found both of those on Taobao, too. Looks like the emulator chips are going to be about $2.22 each, which is more than I'd expect. the e-Link debugger is $48.

That, if you're insisting on the "no crystal" rule. 8MHz for the (legacy) ATmega32a, ATmega8a, ATmega128 and (new) ATmega168pb, ATmega88pb...

My experience is opposite yours - the only designs without some sort of external crystal or oscillator I've seen are the ones with the really small pin-count CPUs.
Arduino has crystals (two of them!) Cheap mice have resonators. Cheap eval boards have crystals. Perhaps in your quest for <$1 chips, you haven't run into as many chips with larger pin counts. But they are available. External timing is generally (and perhaps inaccurately) seen as necessary for serial communications, and you need rather good crystals (or some other time source) if you want to to keep "acceptable" time (1 minute/day is better than 0.1% accuracy.)

Voltage is another problem. The device I use for measuring really accurate current consumption only outputs 3.3V

I'm pretty sure most of the ATmega's we're talking about run at 3.3V, at least at the speed supported by the internal oscillator.

My experience is opposite yours - the only designs without some sort of external crystal or oscillator I've seen are the ones with the really small pin-count CPUs. Arduino has crystals (two of them!) Cheap mice have resonators. Cheap eval boards have crystals.

Definitely agree with you on mice and other commodity products with really really cheap MCUs in them. Good 1% on-chip oscillators are expensive to make and calibrate, so it makes sense. All USB micros used to need external crystals, but now all the $0.75+ USB micros do crystal-less designs by PLLing from the USB D+/D- signals — lets the USB port on your computer generate the clock. Brilliant. The CH340 and other cheapo USB peripheral chips still use crystals though. Other, non-USB cheap MCUs? Idk... seems like most of them are crystal-less, too. I think everything you're saying was dead-on... 5-10 years ago. But $1 buys you a lot of microcontroller these days.

westfw wrote:

Perhaps in your quest for <$1 chips, you haven't run into as many chips with larger pin counts.

I mean, $1 isn't going to buy you a 144-pin beast, but most of these chips I've listed are 24-32 pin. The STC15W is the monster — 40-pin PDIP (with 61K of flash! $0.88!)

I think the Freescale KE04, Tiny1616, and SAM D10 are the smallest at 20 pins.

Definitely no 8-pin doodads.

westfw wrote:

External timing is generally (and perhaps inaccurately) seen as necessary for serial communications,

I'm pretty sure most of the ATmega's we're talking about run at 3.3V, at least at the speed supported by the internal oscillator.

Yup, good point. They all run at 3.3V with their internal oscillator.

westfw wrote:

and you need rather good crystals (or some other time source) if you want to to keep "acceptable" time (1 minute/day is better than 0.1% accuracy.)

Yup, RTCs and RF are the two exceptions I see all the time and design with myself.

I'm glad you mentioned time-keeping, because RTCs are actually one of the reasons why I shy away from MCUs without good, full-speed internal oscillators. Since most general-purpose MCUs only have one crystal input, you're sort of up a creek if you need precise time-keeping if you're using something that doesn't have a full-speed internal oscillator or a PLL/FLL. Sure, you can hook up an RTC to your crystal input (I assume?), but when you wake up from an RTC event, you'll be running at 8 MHz instead of 20 MHz. At best, it's just going to drain your battery faster (maybe not an issue for your application). At worst, it isn't going to be able to run your code fast enough to do whatever it's supposed to be doing.

I bet you that in many applications, neither of these is an issue. But the whole point of this review is to provide exposure to a wide range of MCUs, and point out some trends.

At the most basic level, I want to help people develop some intuition when they ask themselves "What can I get for a buck?" — and, because I'm involved in education — "I know Arduino. Now what should I learn?"

I paid $65.00 direct from Holtek's USA website so nice deal. Shipping may bite you though.

jaycarlson wrote:

Is there a better place to buy this stuff, @jgmdesign?

Looks like you found a better place. I bought everything direct from Holtek.

This site is dedicated to the AVR, so for me to start delving into the ins and outs of a competitors product would be "Tacky" to say the least. Your question in your OP was regarding sub $1.00usd micros, and the parts I mentioned above, along with some of their relatives fit that parameter so I mentioned them.

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Alright, I'm planning on setting up the Tiny1616 code tonight in Atmel Studio. It's my understanding that ASF only supports megaAVR and ARM parts. What's Atmel's recommended peripheral library to use? Is there a code generator tool for peripheral initialization I should be using? Searching the Google didn't immediately yield anything, so any recommendations are appreciated!

As for "being picky" literally *every other* microcontroller that I'm reviewing operates at full speed on 3.3V from an internal oscillator. I don't think I've ever had to lay down a random 20 MHz crystal on a board to drive an MCU before in my life. It's just sort of a weird, foreign concept. Should I include the price of the crystal when talking about the MCU price? What about package dimensions? Small crystals are really expensive. Or do I just test the mega with its fastest internal oscillator, as this is the configuration that most designs will use? 16 MHz, I think?

Voltage is another problem. The device I use for measuring really accurate current consumption only outputs 3.3V, which literally every other MCU plays fine with. Do I cobble together some other way to accurately measure current consumption — just to test this single part? Do I test it at 3.3V, which, again, I assume most designs will be using?

I think it's fine to test at 3v3, & internal oscillator is fine, provided you state the MHz used. That gives one known point on a curve, and users can figure 5V from that and the data sheet curves, which are quite good for Atmel.

If doing a Matrix, is it useful to spec if the part can use Crystal, as it is a new trend to remove Xtal osc ability from some MCUs.

That makes the 'next step' for better precision, an external Oscillator, which can cost more than the MCU.

Are you able to easily measure the internal oscillator frequency ? Reporting that, even for a small sample size, can give some idea of factory-cal precision.

I think the criteria for the selection is a bit arbitrary, as everyone has their own areas of interest and expertise.

That said, you carefully defined the criteria, so be it.

I had to laugh a little at the debugger availability requirement.

When I used UV erasable 2716's (?), and 15 minutes per code/test cycle, using a true ICE was very useful.

These days I debug with an LED, an LCD, and an O'scope.

In my hands I can debug faster with this toolkit than I can match my HLL to ASM to a breakpoint and what some register holds.

YMMV, obviously.

I have a Dragon or two, but the last time I used it was on very early XmegaE5 chips.

Likewise the low power requirement.

If you design battery powered applications that will be important.

I don't, so it isn't.

But then most of my stuff is either hobbyist oriented, or are one-off projects to meet a specific requirement and are not intended for mass production.

The only time I got burned on power it was for an early GPS automatic vehicle location system, and the GPS used ~ 50 mA.

The first prototypes didn't power the GPS on and off, but kept them running for instant location, (no warm-up), and if the vehicles sat non-used for a few days they could run down the vehicle's battery. Since the GPS and the radio link used far more energy than the micro, the micro's current just wasn't an issue.

For most of my projects once I plug in a wall-wart saving the planet just isn't a priority.

Interesting comments about external Xtals.

As noted, many small 8-bitter projects / devices might run well on the internal RC Osc.

The Xmegas, (and perhaps the newer Tinies), have much better accuracy than the older Mega chips, but the Xmegas exceed the $1limit.

Most of my projects have had an external Xtal, although truth be known some of them clearly didn't "require" one.

Old habits on that one, I guess.

For short, easily maintainable code, removing unnecessary routines is helpful, and USART auto-synch is an easy one to ditch.

For quantity < 10 boards, the cost of an Xtal and two caps just isn't an issue.

Speaking of cost, the cost < $1 is an interesting spec.

That might make sense for mass produced products.

Not my world, however.

Cost of the micro, be it $1 or $10 just doesn't matter.

Familiarity with the peripherals, I/O pin count, language/IDE, etc., are more important.

Anyway, the point is I suspect the specific spec's for the review vary widely in importance to different members of the audience.

That said, however, I found the range of offerings, and associated comments, very interesting.

[ST-Link debuggers] are less than $2 on AliExpress, it's a bit ridiculous.

Yeah, it's nice to see vendors handing out schematics and firmware hex files to their debuggers. Both ST's ST-Link and Freescale/NXP's OpenSDA debugger on their FRDM boards are fairly open, and it's cool that both can be programmed with free J-Link firmware, too. Which means that $2 ST-Link is now a $500 J-Link debugger (read the EULA, though).

You can get $10 clones of Silicon Labs' C2 debuggers on eBay, or just buy the pre-programmed debugger chip and build a board yourself (that's what I did!), and PicKit clones are <$20 on Amazon last I checked.

Seems like everyone's moving in the direction of low-cost "MCU breakout" boards with on-board debuggers, which is great. Feels like ST was the first? Not sure on that, though. I always hated having to use those old-school "evaluation boards" that seem like they're designed more to market an MCU with flashy LCDs and stuff, instead of providing a useful development environment.

Silicon Labs is still kind of stuck in that old-school evaluation board mindset, but they have a great on-board current measuring device with a huge dynamic range that integrates with Eclipse nicely for real-time plotting.

I really like that Atmel is making these Xplained Mini boards — I just wish they had jumpers on them like the MSP430 Launch Pads or ST Discovery boards so you could easily debug external targets. It looks like the only way I'll be able to do that is by slicing some tracks on the PCB, or popping off the target MCU, as they don't even have removable zero-ohm resistors :-(

I really like that Atmel is making these Xplained Mini boards — I just wish they had jumpers on them like the MSP430 Launch Pads or ST Discovery boards so you could easily debug external targets. It looks like the only way I'll be able to do that is by slicing some tracks on the PCB, or popping off the target MCU, as they don't even have removable zero-ohm resistors :-(

Yes, that's a poor oversight.

I like the approach Nuvoton, Infineon & some others use, which is to have a very clear Debug PCB area, and with a break-off/cut line, with pin headers each side, not fitted.

I also like the debuggers with Crystals, as that gives a precision timing reference that can be used to check the MCU oscillator.

Neat -- I'll throw it into the mix since there appears to be a lot of interest.

gchapman wrote:

fyi, CoreMark does that in a portable form (across MCUs)

Yeah, maybe it's just me, but I feel like reading "16-bit second-order filtering at 400 kHz" gives me better intuition for how powerful a processor is.

gchapman wrote:

or AVR, Atmel teamed with IAR for the C compiler. IAR EWAVR Kickstart is the 4KB zero price version (Windows only)

I don't think I want to get into a compiler review scenario, so I'll stick with the manufacturer-supplied toolchains. Maybe I'll play with EWAVR a bit. Is this more commonly used by professionals than Atmel Studio? Sorry, I really don't know this architecture very well at all.

@gchapman, I have to sincerely thank you for taking so much time to walk me through everything and provide links to most everything you mention. I'm new here, but I'm quickly wishing there were more people like you on the other forums I visit.

How do you access Taobao ? All I can find is Chinese, and what look like translate-wrappers that are 3rd party ?

When I had my wisdom teeth taken out and I was jacked up on hydro, laying in bed with my laptop, bored out of my mind, I set up an account. The most annoying thing about Taobao is it's a little "too secure" — your account has to be linked to a mobile phone number, and they'll do a 2-factor authentication whenever you sign in on a new device.

Use Google Chrome's built-in page-translation capabilities. You'll feel like you're on eBay or Ali Express. Seriously, it's uncanny. I often forget if I'm on Taobao or Ali Express (that is, until I look at the prices...)

The hardest part is setting up an account. Lots of javascript-based pop-ups you have to fill out that Google Translate doesn't pick up on. At one point, I had to find "United States" (美国) in a list of countries. They were alphabetized, but... well, I don't speak Chinese.

If you can't select text to paste into https://translate.google.com (like a hint in a text field, for example), hit F12 to pull up the developer console, find the HTML, and select the text that way.

When you find something to buy and you click "Add to Cart" nothing will happen — you always have to click the "the country" pop-down by the originating location, and choose "overseas" before the javascript will let you click the "Add to Cart" button.

This all seems moderately insane, but after you spend an hour doing it, you'll have access to an amazing resource to buy stuff.

Taobao uses shipping consignment companies, which is awesome. Let's say you buy 10 different items from various vendors on Taobao. Instead of paying EACH of those to ship overseas, you actually pay local postage (<$1) to ship them to these consignment warehouses, which then package stuff up and ship it to you in one box. It takes longer, and it's a two-step purchase process, but it's cheaper. By the way, it really is a two-step process. Once the items arrive at the warehouse, I think you only have 10 days ship them. So it's annoying if you're waiting on an item or two to ship. make sure you login and keep track of that stuff, because after 10 days, I think they either start charging fees, or send the items back to the seller.

It looks like most sellers offer direct shipping, too. You can check the "Ask the seller to ship" checkbox when submitting payment, and write a little note with your address. Again, seems sketchy, but these people really do work hard to make things right. One guy kept the fast EMS shipping — overseas — and didn't charge more for shipping. I felt kind of bad.

Taobao is operated by Alibaba, which is equivalent in size, scope, and corporate stewardship to eBay. If you trust eBay, you should trust Taobao.

All financial transactions go through Alipay (Alibaba's PayPal equivalent), and it works similarly to eBay or Ali Express.

The site has a wayyyy better selection of silicon than AliExpress does, and the site allows partial string searches, which is amazing for us electronics folks. "STC15W" on AliExpress only turns up three hits — if you wanted to find some STC15W parts, you'd have to iterate through all of the different part numbers. On Taobao, "STC15W" yields 86 pages (yes, pages) of results.

I'm not quite sure how Newark's "excess inventory" pricing relates to the real world, though. Digikey's price for the same chip is up near $4, I think.

The availability of "very cheap" large-ish pincount microcontrollers is a bit of a game changer; it reminds me of when I first noticed that 74xx ICs from the dealers in Popular Electronics were cheaper than mere transistors from my local "electronic parts store" (Lafayette (sp?))...

As a hobbyist, I am more interested in a part that can do "everything" and modest. A commercial product is more interested in "sufficient" and CHEAP.

These days, everything really means everything. Even a modest modern MCU like the Tiny 1617 has DAC, event system, custom logic, it's impressive. Cypress has configurable analog blocks, and the modern SAM L series also has configurable analog.

Sometimes, the CPU hardly needs to do anything, just configure the peripherals and go to sleep. The peripherals are becoming so smart, they can do simple tasks on their own. And of course, the datasheets to explain all that can easily grow beyond 1000 pages...

I am sure that these Chinese websites can deliver with such ridiculously low prices. It all seems too complicated for me as a hobbyist.

Your $1.00 quest becomes crazy when the "Tabao" market is involved. On the other hand, when you are committed to 100k production, how reliable would these sources be?

Haha, this thread has gone off-track a few times (which led to some great discussions), but just to clarify: I'm talking about $1 or less, shipped from a major U.S.-based distributor (something you'd find on Octopart), or directly from the manufacturer in quantities of 100. Newark has crazy sales and close-out specials all the time that I'm not considering, nor am I considering Taobao prices. That was just for fun.

So yeah, I totally agree with you. I play around on Taobao not because of the prices (who cares? we're talking about paying 30 cents instead of 80 cents), but just for fun — and also for access to East Asia ICs that I don't otherwise have any access to.

STC is a great example of a huge manufacturer of 8051 MCUs that have a totally reasonable, hobbyist-friendly development path (free Keil or SDCC download, USB-to-serial converter for programming and debugging, decent English datasheets, and 23749283472938472 different web sites out there with 8051 samples). But it's tough to find STC parts outside of Taobao / Ali Express.

david.prentice wrote:

As a hobbyist, I am more interested in a part that can do "everything" and modest.

Oh, totally. If I'm building one-offs, I'd have no problems paying for a $5 or $10 MCU. But:

MCUs that can do everything (popular example is the STM32F4) are complicated to configure, use, and lay down on a board.

There are a ton of $1 MCUs that I'd say can do "about anything" that are also *really* easy to use.

I think the disconnect is that some people on this thread have it stuck in their brains that cheap MCUs from lesser-known brands must be really unfriendly to use, as they're not popular among hobbyists. But in my testing so far, I've actually found the opposite to be true. As an example, I had never touched a Renesas part in my life before last weekend, and I had an entire DMX-512 RGB LED project built from start to finish in about fifteen minutes.

Modern code-gen tools and well-documented peripheral libraries, coupled with the fact that most manufacturers are going to Eclipse-based IDEs means that it's super simple to jump around between architectures. I'm talking, like, an hour's worth of work to skim through the datasheet, download the tools, and get stuff set up before you can start your project. It's insane. Anyway, that's what sparked this whole quest in the first place.

... this thread has gone off-track a few times (which led to some great discussions)...

And here comes another one...

jaycarlson wrote:

STC is a great example of a huge manufacturer of 8051 MCUs ...

The '51, in its original form, was the first uC I used and I still have a bit of a soft spot for them. However, I also remember that they weren't very good at supporting high-level languages; things like the lack of registers that could be used as memory pointers made for some very kludgey generated code.

Have compilers improved that much that they are now a decent match for other, newer, uCs?

I guess Jay's benchmarking will answer that question.

"This forum helps those that help themselves."

"How have you proved that your chip is running at xxMHz?" - Me

"If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

Accessing external memory was never the 8051's strong point. Various chips added one or more dptrs, which was handy. The high clock speed devices just get around this issue with speed. Nevertheless, the 8051 instruction set was quirky but seemed to have instructions that solved most problems easily. I enjoyed writing asm, except when i had to access external ram.

if you want easy set up for a AVR then use mega168pb or something like that, stay away the new tiny's, they are new hybrids that use the HW things from the xmegas, that is good if you come from a xmega, unnecessary complicated if you aren't into AVR's.

with mega168(p)(b) there a ton's of programs (been out for 10+ years).

and about 8051:

I enjoyed writing asm, except when i had to access external ram.

?

what is wrong with mowx using r0 or r1 as pointers that give you a total of 8 pointers to external RAM.(+ DPTR that on some chips, like the atmel LP versions are two pointers)

I concur - for most of my work the engineering time writing the code dominates.

Certainly there will be at least some learning curve going to something "different".

Besides writing the code, there may well be a needed investment in toolchain, programmers, debuggers, and similar. A modest e.g. $250 is still a buck each if you are building a couple hundred.

Besides writing the code, the design itself to get a solid board with the "different" chip has a learning curve. For example, once we had done a number of AVR8 apps we "know" how to lay out the board without surprises.

=============

The "about a buck" is still an interesting and perhaps useful exercise. A decade or more ago, it was nearly impossible to make a very simple and dirt-cheap device at domestic prices, even at somewhat higher quantity. About that time, a smattering of under-a-buck micro models appeared. Now, as the thread shows, one can get fairly powerful micros at that price point.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

But it doesn't hurt to step back once in a while and see what's out there. Atmel's AVR pricing has been all over the place since the merger; especially when bought through stocking distribution over here in the UK. I've seen the price of a DIP '4313 nearly double at one point before settling back down to less than what I was paying over a year ago when I last updated the BOM prices.

We can quibble about what seems like the arbitrary set of criteria chosen by the OP but you do need 'rules' to do this sort of exercise. If you start out with a 'no more than 1$' rule but accept devices at $1.10 then why not accept $1.21 and then why not $1.33?

"This forum helps those that help themselves."

"How have you proved that your chip is running at xxMHz?" - Me

"If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

Optimizing pricing for a processor in the hundreds is ridiculous. Buy a good easy to use processor and be done.

Totally agree! If you're building 100 units, you should never drop a proven MCU and switch to a different architecture, solely to save money. That would be ridiculously silly.

I'm not talking about optimizing — the question started as "hey, wouldn't it be cool to look at a bunch of different MCUs out there, check out the vendor tools, debuggers, development hardware, performance measurements, and compare everything?"

But there's an overwhelming number of MCUs out there, and it seems silly to compare an 8-pin ATTiny with an STM32F4, so I thought it would be fun to narrow it down and see what a buck can buy you these days.

Why do this? Imagine that you're starting a new, long-term project, and you're spec'ing the MCU for it. Do you want to drop in the same part you've been using in projects for the last 5 or 10 years? Does it make sense to consider trying out a new MCU architecture you've never used before? Will you see any performance gains? How much faster or easier is the development process going to be?

What's funny is, while doing this, I've stumbled upon ecosystems that I've never used before that I was actually able to get up and running faster than the MCUs I have a lot more experience with. It just shows you how important developer tools are (especially for quick projects where you want to minimize that "DC bias" at the beginning — pin-muxing, peripheral configuration, board bring-up, etc).

The '51, in its original form, was the first uC I used and I still have a bit of a soft spot for them. However, I also remember that they weren't very good at supporting high-level languages; things like the lack of registers that could be used as memory pointers made for some very kludgey generated code.

Have compilers improved that much that they are now a decent match for other, newer, uCs?

I think you would be blown away by the Silicon Labs EFM8 stuff. Three-stage pipelined architecture, running up to 72 MHz. None of this old-school 12-cycle-machine-clock rubbish; this is a single-cycle machine that, clock-for-clock, matches the TinyAVR closely (not going to say more until I finish testing!)

I haven't gotten my EFM8LB11 in yet, but I'm really curious to see if it can hold its own against the 20-30 MHz ARMs in the field (highly doubt it can withstand the 48 MHz Atmel and NXP parts, but we'll see!)

The best part about the EFM8 for hobbyist / one-off projects is all the code-gen tools that Simplicity Studio, their free IDE, has. Comes with a full version of Keil C51 for free. I think hobbyists/makers will appreciate that it's got identical support across Windows, macOS, and Linux, too. No need to cobble together an open-source toolchain (which can be fun, but overwhelming if you're a beginner).

As for the quality of the compilers, ironically, the 8051 / Keil C51 combo is one of the only compiler setups I haven't had to configure at all in my testing; while I had to mess with RL78-GCC, AVR-GCC and ARM-GCC compiler settings extensively to be able to get it to toggle a GPIO pin efficiently, Keil C51 produced a two-instruction "xor" / "jump" routine without even turning on the "optimizer"

This makes sense; it's 2017 — surely we can build a compiler that produces efficient code for CISC architectures.

I haven't gotten my EFM8LB11 in yet, but I'm really curious to see if it can hold its own against the 20-30 MHz ARMs in the field (highly doubt it can withstand the 48 MHz Atmel and NXP parts, but we'll see!)

Being 8 bit, it will compare well on boolean/byte level operations, and no so well on 32 bit maths.

The real appeal of a part like EFM8LB1, is in the peripherals, where it has 14b ADC and 12b DACs, and I've found the DACs work just fine as INC DAC and DEC DAC SFRs for up to 36MHz step-rate linear ramps.

The real appeal of a part like EFM8LB1, is in the peripherals, where it has 14b ADC and 12b DACs

Yes! I'm excited to play with it. All I've played around with is the EFM8UB1 and the EFM8SB1 parts so far. Well, "played around with" is the wrong word — I just wrapped up a 2000-run commercial project with the SB1, and it worked like a treat.

Who-me wrote:

I've found the DACs work just fine as INC DAC and DEC DAC SFRs for up to 36MHz step-rate linear ramps.

That's crazy — I never thought about that. Like I said, I'm super excited to play around with that part when it comes in.

My Nuvoton N76E003 dev board just showed up, so that's what I'm playing with right now. Thanks for the recommendation on that guy, by the way! They have a bizarre SDK that's quite different from anything I've seen before — looking forward to writing it all up.