Are AVR microcontrollers obsolete? - Page 1
Forum section: electronics / general

author: Chris42
author_rank: Contributor
timestamp: July 15, 2020, 07:12:32 pm
content: I'm currently in the process of designing a driver board for a project.One of the big design decisions that I have to make is the choice of microcontroller. Application is not very demanding in terms of processing power or peripherals. Microcontroller in this project basically measures the delay between two pulses an sends that delay to the PC via USB-UART converter. It also does some adjustments of digital potentiometer via I2C bus. Nothing to complicated. Atmega328p will do the job just fine.But in modern products I don't see many uses of AVR microcontrollers. I see them mainly on arduino boards or in some DIY kits which exploit the fact that they are available in THT packages.That raises the question whether the AVR microcontrollers are obsolete and I should go with STM32 even though AVR can handle the task.What do you think?

author: JPortici
author_rank: Super Contributor
timestamp: July 15, 2020, 07:49:48 pm
content: No they are not. It's just that the people designing these "new products" may be more accustomed with STM32 so they want to keep a smaller codebase, or are more familliar with the architecture.For your "product" (measuring the delay between two pulses and sending the data to a PC via USB) i'd use a PIC18F25K50 or a PIC32MM instead.. or a dsPIC if the required time resolution was finer than what the two above can handle...Because i use PICs 99.9% of the time and i can get the bulk of the firmware done and tested in less than a daychange PIC with whichever product line you are accustomed with

author: uer166
author_rank: Super Contributor
timestamp: July 15, 2020, 07:56:08 pm
content: They're not obsolete, but modern products are designed to minimum cost, and AVR has a pretty terrible feature/cost ratio compared to M0+ ARM MCUs and such. If it is appropriate for the application and the price is right then there's no reason not to use and AVR (or any other micro that's not obsoleted).

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 15, 2020, 09:06:46 pm
content: Use the best bang for your buck.Hobby projects, one-offs: what you're already familiar with, is cheap, and currently stocked.Short production runs, 1000s units, few years lifetime: same idea, with a little more emphasis on stocking, availability, lifetime etc. Your dev time will still be a substantial portion of the total cost; don't bury yourself under the avalanche of a new toolchain.AVR is very much in this space. Arduino using it, means it's stupid easy to get started, and you can always improve from there (libc, plain C/C++, ASM, etc.). Microchip is unlikely to pull support or production of, really any chips, any time soon, and there's no reason to suspect their Atmel brand will. (Unless, of course, they say otherwise. Check the product pages.) They have a pretty good record of legacy support. Legacy products might not remain cheap... but remaining available at all, yes.Medium production runs, 100ks units, decade or two lifetime: shop for a cheaper micro. Take the time to learn the toolchain. You might leverage a popular or familiar family (CMSIS libraries for example are broadly supported on most all ARM platforms), saving you the trouble of learning the gritty details of a particular implementation. Stick to major vendors, they will have good support (they'll engage with you, on this level of production) and lifetime, and relatively well-known products. This kind of quantity gets good pricing too; negotiate with sales.Or you might, sort of, go the other way: choose a new, but incredibly simple platform. 8051 for instance, easy to learn (heh, give or take the peripherals and errata hanging off it..). Unlikely to go away, in some form or another, basically ever (8051s are the cockroaches among microcontrollers: they're survivors, you'll never kill them off completely). PICs of various flavors (18F, and smaller even) are affordable, and also pretty safe from extinction; mind Microchip's notorious errata, and that their newer, ever-more-specialized PICs have some pretty complicated peripherals on them. Older (and possibly more mature?) parts, with typical MCU peripherals, may be a safer bet. Shop around.Families like AVR won't look too attractive on this scale. The cheapest ones, if you don't need much functionality, can still be competitive -- the smaller MEGAs and most TINYs. Anything fancier than that, and even a base model STM32F0 for example thoroughly beats it.Large production runs, 1M+ units, multi-decade lifetime: you can beat up on suppliers, negotiating near cut-throat prices. Consider Chinese junk specials: poorly documented, buggy, extremely cheap. Have a guy or two poke at it and figure it out; reserve some months in the project timeline for this. Mask ROM is very much an option; talk with various vendors. Chip-on-board and chip-on-flex are very much options. Committing an engineer or two to production maintenance is very much an option. For example, shopping for and developing the codebase for the next replacement chip, and so on. Set up a pipeline of substitute and replacement components and designs, to anticipate the inevitable discontinuation of current parts. (Because those cheap MCUs come and go like the tides--or, so I would guess? Very likely you have at least a few components that do, anyway; LCD displays are a notorious example.) Engaging with your numerous CMs will reap great rewards (V&V engineering).As quantity, budget and timeline go up, of course your options broaden in all respects. You can afford time to learn several new platforms; or you can afford to pay employees or contractors to do it for you. You have more leverage over suppliers, and more flexibility between suppliers -- if it's only a mere $20k in labor to port the design over to a new platform, hell yes you're going to look into that $0.10 cheaper MCU-from-hell, and hell yes you're going to beat your current supplier over the head with that alternative price!Conversely, when quantity, budget and timeline are very short in supply, your options are very narrow: stick to what you can already work with. If you can, budget generously, to bankroll research in other platforms -- as a contractor you might quote extra to cover the downtime between rush jobs; as an employee, you might experience the same downtime, and studying a new platform is a perfect way to pass that time (and getting paid to do it!).Tim

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 16, 2020, 01:33:18 am
content: Quote from: Chris42 on July 15, 2020, 07:12:32 pmAVR and other 8 bit MCUs are very much alive and well.There are new AVRs being released all the time.A simple check on Digikey New products MCUs gives228 8-bit349 16-bit379 32-bitSo 8 and 16 bit MCUs are still very active. You can choose a package to suit, & I see some new MSOP10 8-bit packages.Note that it is less common to find wide-supply 32 bit MCUs, so if you need 5V operation and modest grunt, 8 bits is fine.Quote from: Chris42 on July 15, 2020, 07:12:32 pmWhat timing precision and number of digits do you need ?If AVR works, and it is what you already know, why change ?Only if the delay needed higher precision, or more bits than AVR can capture, would you look at other MCUs.8b MCUs are good up to around 50MHz, and some can capture 32b time, above that you would look at ARM MCUs

author: Chris42
author_rank: Contributor
timestamp: July 16, 2020, 10:20:43 am
content: Quote from: Chris42 on July 15, 2020, 07:12:32 pmWhat timing precision and number of digits do you need ?I already verified that 16-bit timer in Atmega328p running on external 16MHz crystal provides sufficient accuracy. In fact I already have a working proof of concept running on Arduino Uno board.Since this is a one-off project (max 3-4 boards) and the cost is not really that important so I will probably just use Atmega328p so I can reuse code from my proof of concept board.

author: woofy
author_rank: Frequent Contributor
timestamp: July 16, 2020, 01:21:29 pm
content: AVR is very much alive and well, though the 328 is getting a bit long in the tooth.My goto microcontroller search page is:https://www.microchip.com/ParamChartSearch/chart.aspx?branchID=1005There you can select any of Microchips 8/16/32 bit controllers. Just enter the the selections and sort by price to find the best bucks for the specified bang.But for 3-4 boards, does obsolete even matter? I'd use whatever I had laying around.

author: phil from seattle
author_rank: Super Contributor
timestamp: July 16, 2020, 04:37:49 pm
content: One thing not mentioned is pin drive capability. Most of the ARM chips have fairly low current drive - 6 to 8 mA where the AVRs generally have much higher - 25 mA or so is fairly common. If you need the drive, an AVR might be more cost effective. Also, most ARMs are 3.3V or less (and usually not 5V tolerant) so in cases where there is 5V logic to interface to, it adds parts/cost.

author: Mr. Scram
author_rank: Super Contributor
timestamp: July 16, 2020, 04:45:51 pm
content: In terms of simplicity they're an attractive option. It's easy to get them going and are also electrically quite robust. There's no endless registers or complicated setup to do. It's very doable to stick them on perboard and manually wire them up. The downside of all that is that there are much more capable chips for equal or less money. Pick your poison, as long as it gets the job done.

author: brucehoult
author_rank: Super Contributor
timestamp: July 16, 2020, 11:56:11 pm
content: Quote from: Chris42 on July 16, 2020, 10:20:43 amThen definitely go with the AVR. Crazy not to.If you've only got one input, one uart out, and one I2C than you could possibly even use an ATTiny85 in an 8 pin package. They're even easier to work with (bare) than a 328.The price difference though is only $1.20 vs $2 qty 1 at Digikey (in DIP-8 and DIP-28). But I like the ATTiny85 and use a few of them :-)

author: Dubbie
author_rank: Unknown
timestamp: July 17, 2020, 12:33:50 am
content: I just grabbed some ATTinys from my microcontroller drawer for a quick project the other day.I've been using Cortex M4s for the last few years. I had forgotten how incredibly easy the AVRs were to program.I had the software done and dusted in about an hour from scratch.No clock tree to worry about, no need to set anything up. Just write to a few registers and you're done.

author: langwadt
author_rank: Super Contributor
timestamp: July 17, 2020, 12:52:38 am
content: more like obsolescent

author: Siwastaja
author_rank: Super Contributor
timestamp: July 17, 2020, 09:32:16 am
content: Quote from: Dubbie on July 17, 2020, 12:33:50 amYes, but to be fair, simplest Cortex M0 parts are notmuchmore complex, and they definitely give you more bang for buck, if you need that bang of course. When you don't, all that matters is the product lifetime, which isn't automatically good for the ARM parts, either. Need to check the support and availability guarantee foranyspecific part.

author: MarkR42
author_rank: Regular Contributor
timestamp: July 23, 2020, 10:05:19 pm
content: The Atmega328 is a bit long in the tooth and there are *loads* of newer chips from Atmel / Microchip.The Attiny 1-series and 0-series are 8bit mcus with a very nice set of peripherals, good documentation and simple stuff, combined with a cpu that runs mostly very similar instructions as the old ones.At least I like them. If they do what you want, they're much simpler to use than arm-based or other 32-bit stuff.