Author Topic: Chip shortage, which microcontroller to choose  (Read 3846 times)

0 Members and 1 Guest are viewing this topic.

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Chip shortage, which microcontroller to choose
« on: November 28, 2022, 09:14:42 am »
I make high precision sensors in low volume (20-100/year) for global market. I need to make a new model, since the actual sensor chip I have used is out off production. I checked through the BOM of the current model and it seems to be totally impossible to get most of the active components I have used before.

So let's start with the microcontroller. I have used AVR XMega, which seems to have totally disappeared from the vendors. Last time I ordered these in Summer 2021 I still could find a drop in replacement, although not exactly the same I used before. Now there is nothing.

What would be a good option, which would likely be available now and for the coming about 10 years or so (the two current sensors I produce were designed in 2007 and 2013)? XMega has been easily fast enough (actually run at 4 MHz) and has enough ports (would need to have 1-2 SPI and 1 UART, maybe USB). I prefer to use GCC. 3.3 VCC would be easiest.
 

Offline mino-fm

  • Regular Contributor
  • *
  • Posts: 143
  • Country: de
Re: Chip shortage, which microcontroller to choose
« Reply #1 on: November 28, 2022, 10:15:04 am »
Just buy 10k of RP2040 so they will help you the next 10 years ;-)
 

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #2 on: November 28, 2022, 10:32:28 am »
Just buy 10k of RP2040 so they will help you the next 10 years ;-)
Seems to be in stock and cheap (1 €), but not cheap enough to by 10k of them. Never heard of that one before, but seems to be an ARM Cortex-M0. Is that a good option? I have used SAMD21 in one project. Basically the same?

One thing I forgot to spec is a package somehow suitable for hand soldering or a heat gun. So far I have used outsourced reflow for one model and hand soldered the other. For both hand soldered the prototype. The RP2040 package looks a bit difficult for hand soldering, but maybe manageable.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21675
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Chip shortage, which microcontroller to choose
« Reply #3 on: November 28, 2022, 10:50:54 am »
If you're used to AVR, the AVR-Dx would seem the next logical step.  Peripherals are different from both MEGA and XMEGA so there's some getting used to.  I would rate them comparable or more powerful than XMEGA, largely because of the peripherals which are more configurable than ever (thanks to even more event sources/sinks plus CCL).  Last I checked, they were moderately available, though I'm sure the exact supply varies (i.e., 100s available here or there across the family).  Maybe they're all unusually short at the moment, I don't know.

RP2040 is certainly not a SAMD21... but if you're doing mostly CPU functions, it might not matter.  Point in case, it's all about the peripherals, everyone and their uncle makes ARM chips but it's what they hang off them that makes all the difference.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline mino-fm

  • Regular Contributor
  • *
  • Posts: 143
  • Country: de
Re: Chip shortage, which microcontroller to choose
« Reply #4 on: November 28, 2022, 10:55:33 am »
Seems to be in stock and cheap (1 €), but not cheap enough to by 10k of them.

So take 100 as a first step instead.

Quote
One thing I forgot to spec is a package somehow suitable for hand soldering or a heat gun.

Look for Raspberry Pi Pico-Board using RP2040 priced arround $5. It's very easy to handle if you got enough space.
Let me show you one application of mine:
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Chip shortage, which microcontroller to choose
« Reply #5 on: November 28, 2022, 11:14:01 am »
Just buy 10k of RP2040 so they will help you the next 10 years ;-)
Seems to be in stock and cheap (1 €), but not cheap enough to by 10k of them.

10kpcs would be the stock for 100 years.  :)
10 years at 100pcs/year is only 1kpcs, or 200pcs for the minimum estimated in the OP.

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #6 on: November 28, 2022, 11:51:29 am »
If you're used to AVR, the AVR-Dx would seem the next logical step.
Could be. Haven't really been following the new models, since I have been perfectly happy with XMega. Didn't even know about this. Seems to be released 2020. There were a lot of bugs in the early XMega revisions. Are the AVR-Dx already about bug free?

What might be the reason for XMega being totally out of stock, but AVR-Dx seems to have good stocks?  E.g. at Digi-Key only 2 of 224 normally stocked XMega's in stock vs 78 out of 171 for AVR-Dx.
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 334
  • Country: gb
    • Woofys Place
Re: Chip shortage, which microcontroller to choose
« Reply #7 on: November 28, 2022, 03:51:15 pm »
Unless this is an open source project, forget RP2040 - no code protection.

This one any good?
https://www.digikey.co.uk/en/products/detail/microchip-technology/ATXMEGA8E5-AN/5235860
 
The following users thanked this post: hans

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21675
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Chip shortage, which microcontroller to choose
« Reply #8 on: November 28, 2022, 04:02:17 pm »
My guess, other than general popularity -- I'm guessing XMEGAs aren't actually all that much in demand? But, that's entirely a guess -- the -Dx are modern process node so pack a lot more in a smaller die.  They apparently have a low voltage regulator internal, no external bypass capacitor needed.  Hence the fine pitch process and modest clock frequency, despite the 5V IO capability.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #9 on: November 28, 2022, 04:21:08 pm »
Unless this is an open source project, forget RP2040 - no code protection.

This one any good?
https://www.digikey.co.uk/en/products/detail/microchip-technology/ATXMEGA8E5-AN/5235860

Not an open source project, but I don't think my customers nor competitors would copy my design, thus not really a big issue. But what do you mean by "no code protection"? You are required to publish your code or that hex can be copied out from Flash? RP2040 seems to use an external Flash (or USB).

8 kB Flash is not enough. I'm currently using a 64 kB model, maybe 32 kB would still be OK.
« Last Edit: November 28, 2022, 04:23:34 pm by jmaja »
 

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #10 on: November 28, 2022, 04:27:40 pm »
the -Dx are modern process node so pack a lot more in a smaller die.  They apparently have a low voltage regulator internal, no external bypass capacitor needed.  Hence the fine pitch process and modest clock frequency, despite the 5V IO capability.
Doesn't seem to have an USB. So far I have used a FTDI USB module, but have thought about using XMega USB instead. Not a deal breaker, but adds some cost and space.
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6202
  • Country: ro
Re: Chip shortage, which microcontroller to choose
« Reply #11 on: November 28, 2022, 04:37:09 pm »
No code protection usually means the MCU doesn't have any physical lock-bits protection, or other physical mechanism in place (serial number, encryption, etc.) against stealing the binary firmware from an already programmed MCU.

It's about securing the firmware by hardware mechanisms, not about licensing or other written agreements.

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #12 on: November 28, 2022, 05:10:51 pm »
No code protection usually means the MCU doesn't have any physical lock-bits protection, or other physical mechanism in place (serial number, encryption, etc.) against stealing the binary firmware from an already programmed MCU.

That's what I thought in this case. Since RP2040 doesn't have an internal FLASH, I guess no code protection comes from the design. Or is there a way to protect even the external FLASH somehow.

I have used lock-bits for disabling code download from XMega, but as said it's not that important to me. But I don't want to share my C-code.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: Chip shortage, which microcontroller to choose
« Reply #13 on: November 28, 2022, 05:44:49 pm »
It would help to know what specifications you need... how much mips etc etc ... and your budget.

Digikey has lots of PIC16F and PIC18F with or without USB and 32K+ of flash in thousands or tens of thousands in stock, at 1-5$ if you buy just one... better prices in quantity.

For sure there's some ARM chips under 2-3$ each with 32 KB of memory.  ex STM32G030 with 64 KB flash and 8 KB ram (no usb) is 2.14$ at Digikey in 1 piece, $1.5 at 100 pcs : https://www.digikey.com/en/products/detail/stmicroelectronics/STM32G030K8T6/10326689

Some PIC24 chips have 128 KB of flash but not usb... but you say you use ftdi for usb ... so it's just some low speed serial / virtual com as usb ?
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3146
  • Country: ca
Re: Chip shortage, which microcontroller to choose
« Reply #14 on: November 28, 2022, 06:16:01 pm »
What would be a good option, which would likely be available now and for the coming about 10 years or so (the two current sensors I produce were designed in 2007 and 2013)? XMega has been easily fast enough (actually run at 4 MHz) and has enough ports (would need to have 1-2 SPI and 1 UART, maybe USB). I prefer to use GCC. 3.3 VCC would be easiest.

Very strange specification. If you need USB, then only MCUs with USB will do. This restricts the choice. If you don't need USB, then almost anything will do. You need to make up your mind first on that subject.

With your volume, I would buy 500 and that would be enough for a long long time, and you would get some volume break. There's always a danger that what you buy may not work for some reason, but if you were to develop and test everything only to find out that the your chip vanished out of stock, it would be a bummer.
« Last Edit: November 28, 2022, 06:47:50 pm by NorthGuy »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3146
  • Country: ca
Re: Chip shortage, which microcontroller to choose
« Reply #15 on: November 28, 2022, 06:50:30 pm »
Doesn't seem to have an USB. So far I have used a FTDI USB module, but have thought about using XMega USB instead. Not a deal breaker, but adds some cost and space.

If you buy 500 or 1000, using a USB-capable chip may save you $1000 or even more. The more you buy, the more important is the price.
 

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #16 on: November 28, 2022, 07:12:49 pm »
Very strange specification. If you need USB, then only MCUs with USB will do. This restricts the choice. If you don't need USB, then almost anything will do. You need to make up your mind first on that subject.

When I started using XMega 10+ years ago I didn't really care about the USB it had. Later I thought I would use that in the next project, since it had it and was quite cheap (2-3 €). I can continue with FTDI providing USB, if that makes life easier.

This is not a  very price sensitive project. Thus I don't really care that much if the MCU costs 1 or 10 € as long as it works well and can be bought later as well. I don't want to spent 10 k€ beforehand. The sensors chip, enclosure etc are more expensive and the selling price orders of magnitude more due to design, calibration process and software.
 

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #17 on: November 28, 2022, 07:24:02 pm »
It would help to know what specifications you need... how much mips etc etc ... and your budget.

Digikey has lots of PIC16F and PIC18F with or without USB and 32K+ of flash in thousands or tens of thousands in stock, at 1-5$ if you buy just one... better prices in quantity.

MIPS is not a problem most likely. As said I have run XMega at only 4 MHz. There will be some floating point calculations including trigonometric functions, but that has not been a problem at all for XMega at 4 MHz outputting data up to 50 Hz. Probably no problem having 2 MHz SPI and 115200 bps UART, at least with hardware UART/SPI of XMega.

As said USB would be a nice to have option, but I can continue with FTDI.

For some reason I don't like PIC. Haven't ever used them, thus really no reason.

Budget up to 10 €/each.

Low component count is a plus. I have liked the internal accurate enough oscillator.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Chip shortage, which microcontroller to choose
« Reply #18 on: November 28, 2022, 07:29:06 pm »
You could consider the STM32G0 line in this price range. You have a selection of parts supporting USB starting at about $2.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1638
  • Country: nl
Re: Chip shortage, which microcontroller to choose
« Reply #19 on: November 28, 2022, 08:10:33 pm »
No code protection usually means the MCU doesn't have any physical lock-bits protection, or other physical mechanism in place (serial number, encryption, etc.) against stealing the binary firmware from an already programmed MCU.

That's what I thought in this case. Since RP2040 doesn't have an internal FLASH, I guess no code protection comes from the design. Or is there a way to protect even the external FLASH somehow.

I have used lock-bits for disabling code download from XMega, but as said it's not that important to me. But I don't want to share my C-code.

Some MCUs have on the fly decryption for code of external memories. That way only the plain binary is only accessible from inside the chip regions, similar to FLASH code protection.

I'm not going to argue whether you need code protection. If you decide on not needing it, then that's clear. However, as a default stance in any commercial product, I do recommended using it. That's why I wouldn't consider a RP2040 as a good choice for a commercial project. RPi is about education and accessibility after all.

ESP32s are also affordable and available, etc., and I've seen the datasheet/user manual mention it can protect the binary that's stored in external FLASH. How so: no idea, never done it.


Another option to consider is perhaps the PIC24s. The PIC24FJ64GB004 has USB and internal oscillator that's accurate enough for it. It's a different architecture than 8-bit PICs and in that regard quite similar to AVRs. Although, I do wonder: have you used the XMEGA with MPLAB X or Atmel Studio? Some toolchains tend to lead to quite strong opinions, besides how the chip and architecture may operate.
 

Offline jmajaTopic starter

  • Frequent Contributor
  • **
  • Posts: 296
  • Country: fi
Re: Chip shortage, which microcontroller to choose
« Reply #20 on: November 28, 2022, 08:44:33 pm »
Although, I do wonder: have you used the XMEGA with MPLAB X or Atmel Studio? Some toolchains tend to lead to quite strong opinions, besides how the chip and architecture may operate.

Neither. I do have Atmel Studio, but have used GCC directly with my own Makefiles from command line (CygWin + X) and using Emacs as an editor. I hate using Atmel Studio, but sometimes it is necessary to use it due to simulator etc. I also hate the code Atmel Studio procuces and is used in all tuturials and libraries. My code is very different looking and doesn't use the long function call chains used in tutorials.

Never heard of MPLAB X.

I guess I would need to use Atmel Studio for USB, since that would not be worth while coding from scratch.
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: Chip shortage, which microcontroller to choose
« Reply #21 on: November 28, 2022, 09:22:59 pm »
You could consider the STM32G0 line in this price range. You have a selection of parts supporting USB starting at about $2.
STM32G0xx don't have USB (except 'G0Bx/'G0C1). Most of them has support for USBC-PD, and that is not USB.

JW
 

Offline robint91

  • Contributor
  • Posts: 44
Re: Chip shortage, which microcontroller to choose
« Reply #22 on: November 28, 2022, 11:48:15 pm »
Nowadays I just use a ESP32S3-FN8.

- Cheap 2.4€/pcs
- internal flash, 8MBytes
- Decent amount of RAM
- manageable peripherals
- ESP-IDF is quite good, "batteries included" but still low level enough.
- Has USB
- Has secure options
- Has WiFi/ble

I find it really difficult to find a use for other brands when you aren't IO bound.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Chip shortage, which microcontroller to choose
« Reply #23 on: November 29, 2022, 02:47:50 am »
Quote
Never heard of [Rp2040]
Haven't really been following the new [AVR] models, since I have been perfectly happy with XMega.
Never heard of MPLAB X.
Umm.  You should probably pay more attention to ... things in general.

The AVR-Dx are sort of xmega-lite.  They have rich peripherals similar to xmega, but no DMA and no USB (so far.)

Quote
Are the AVR-Dx already about bug free?
Alas, not.  Relatively long errata, which you should check out before trying to use them.

Quote
totally impossible to get most of the active components
Yeah, the current chip shortage is pretty sucky and unpredictable, especially in the quantity range you mentioned.
For all we know, the xMegas might come back before the rest of the components you need. :-(
 
The following users thanked this post: T3sl4co1l

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Chip shortage, which microcontroller to choose
« Reply #24 on: November 29, 2022, 02:52:51 am »
Nowadays I just use a ESP32S3-FN8.

I find it really difficult to find a use for other brands when you aren't IO bound.
That is a good option. Has a Risc-V core if I'm not mistaken. Chips designed in / from China have been surprisingly available despite the shortages.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf