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

0 Members and 1 Guest are viewing this topic.

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6185
  • Country: ro
Re: Chip shortage, which microcontroller to choose
« Reply #25 on: November 29, 2022, 08:48:28 am »
Chips designed in / from China have been surprisingly available despite the shortages.

China might not be a reliable source of MCU either.

Social media tells a rebellion is spreading through China right now, people gathering, demonstrating and fighting with police because they can not take any more the fake virus story, and its zero covid measures.  There was a fire in one of their sealed building, and people burnt alive because they couldn't get out of the building.  Complete isolation there means no way to go out, all the doors are locked and welded, by welders.  Or at least that's what social media shows.

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: Chip shortage, which microcontroller to choose
« Reply #26 on: November 29, 2022, 05:27:46 pm »
Chips designed in / from China have been surprisingly available despite the shortages.

China might not be a reliable source of MCU either.

Social media tells a rebellion is spreading through China right now, people gathering, demonstrating and fighting with police
That is not going to affect production in any way. In the US people actually stormed and occupied the capitol building where the nation's top ranking politicians 'work'. That didn't have any effect on the country's productivity either.
« Last Edit: November 29, 2022, 05:31:10 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3342
  • Country: nl
Re: Chip shortage, which microcontroller to choose
« Reply #27 on: November 29, 2022, 11:22:09 pm »
... AVR-Dx would seem the next logical step.  Peripherals are different from both MEGA and XMEGA so there's some getting used to. 


Huh what?
They've done it again?

I was already annoyed by peripheral incompatibilities between the Mega's and the tinies. At some point I was interested in a faster uC, mainly for TFT LCD's, and I had a look at the Xmega's, and then I learned they were so dissimilar that I might as wel go to a completely different uC family, and I settled on STM32. The main reasons for that were the blue pills (which had a real STM back then) , the pretty nice ST-Link V2 clones, (with an upgrade path to the Open Soure Black Magic Probe, and the GCC copiler and pretty open development tools.

These day's I only use the old atmega's for the projects where they "fit", because I have no interest to buy a new programmer every 5 year because they changed the programming interface again.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Chip shortage, which microcontroller to choose
« Reply #28 on: November 29, 2022, 11:35:50 pm »
Quote
They've done it again?
I was already annoyed by peripheral incompatibilities between the Mega's and the tinies.
Yep.  Not only different peripherals, but a whole new way of accessing them (now structure-based rather than individual registers.)

On the bright side, I think the new Tinies and Megas are more compatible with each other than they've been in the past.

 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26896
  • Country: nl
    • NCT Developments
Re: Chip shortage, which microcontroller to choose
« Reply #29 on: November 30, 2022, 01:09:01 am »
Quote
They've done it again?
I was already annoyed by peripheral incompatibilities between the Mega's and the tinies.
Yep.  Not only different peripherals, but a whole new way of accessing them (now structure-based rather than individual registers.)
Using structs and a typedef to access peripheral registers is standard nowadays. It takes some getting used to and you can argue it is syntactic sugar coating. OTOH in many cases modern day microcontrollers have several identical peripherals and having a pointer to a struct makes it easier to deal with a peripheral. You can have functions that accept a pointer to such a struct and deal with a peripheral in a unified way. Instead of copying the same code over and over with different register names.

Not so long ago I rewrote my UART handling abstration layer to use an array with pointers to structeres with the registers. The interrupt handler calls a function with the pointer for the particular UART. Works nicely for NXP and ST ARM microcontrollers.
« Last Edit: November 30, 2022, 01:12:08 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Chip shortage, which microcontroller to choose
« Reply #30 on: November 30, 2022, 11:10:11 am »
Quote
They've done it again?
I was already annoyed by peripheral incompatibilities between the Mega's and the tinies.
Yep.  Not only different peripherals, but a whole new way of accessing them (now structure-based rather than individual registers.)

On the bright side, I think the new Tinies and Megas are more compatible with each other than they've been in the past.

Well, that was introduced with the XMEGAs, but they carry on.  DA is based on xmega2 core, I think ("AVRxt" in the instruction datasheet).

The weirdest syntactical thing about that, I think, is the TCA is written as a union even.  So you have to specify TCA0.SINGLE.BLAH or .SPLIT. every single time.  But eh, it's just for a little IO, and toss it in a macro if you find it annoying.


I found the TCD docs highly confusing, and TCA a bit hard to parse but not quite as bad, and TCB factually wrong on a certain aspect (when they say it's "stopped", in applicable states, they really mean it doesn't count when CNT = 0 or CMP or whatever; likewise, you can force a reset by setting CNT = CMP or MAX; the text implies additional internal states, but in fact, as far as I can tell, it's strictly the count compared to other registers, and decision logic so you aren't required to use an event to trigger/stop it).  I think everything else is pretty much as it says, as you'd expect?  Again, check the errata of course.  I didn't discover any device errata (doc errata I would argue so), but confirmed a few, they're not too bad.

Going from MEGA to XMEGA/Dx will be a minor culture shock because of the syntax, yeah; from XMEGA to Dx, almost nothing.  PORT, USART, SPI, DAC and probably others will be familiar from XMEGA; ADC is... kind of hybrid I'd say, some XMEGA features (and yes it's 12 real bits, and the internal refs aren't bad), but stripped down a bit (no auto sequenced mux, have to service that from interrupt).

At least, that was the DA I used most recently, perhaps more advanced peripherals (bring back XMEGA ADC? etc.) go on the later series, I haven't checked.

If you're particularly slow at reading peripherals docs*, by all means invest in something much more powerful, and potentially more consistent across the series / families.  (I don't know much detail offhand about STM32s, I would guess they do a mix of both [keeping and changing things] too?)

(*Not a knock, just an honest self assessment.  I feel like my own reading comprehension has dropped a bit over the years.  Not enough to be a problem, but I feel slower I mean.  If you're much slower still, or more error prone, indeed it would be a good investment to commit to studying, in as much detail as you can force yourself through, a platform more powerful than you will usually need, so you aren't stuck poring over datasheets of myriad smaller chips, but also bigger chips, on the occasion you would otherwise need to use them.  The cost is easily justifiable as long as quantities are small (sub 1000s?).  Or, also a possibility in this sort of case, you could have [late onset?] ADHD, and treatment may be available; in any case, whatever works for you. :-+ )


These day's I only use the old atmega's for the projects where they "fit", because I have no interest to buy a new programmer every 5 year because they changed the programming interface again.

FYI, if you have like a AVRISPMKII or newer, PDI is supported, which means XMEGA is available.  The Dx use UPDI, but UPDI doesn't even need a programmer as such, you can do it from any old serial port (logic level) with a resistor.  I literally use a FTDI TTL-232R-3V3 and adapter cable.  Be sure to get the latest version AVRDude to support it.  But yeah, notwithstanding the above. :)

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf