Author Topic: Yeah.. which micro?  (Read 15398 times)

0 Members and 1 Guest are viewing this topic.

Offline ssashtonTopic starter

  • Regular Contributor
  • *
  • Posts: 220
  • Country: gb
Yeah.. which micro?
« on: December 05, 2021, 07:13:18 pm »
I'm in the process of designing and coding my first product that uses a micro. It's not large scale, just a cottage business.

I am prototyping with an Arduino Uno, it's that simple, just drive an OLED and send I2C commands to a dedicated DSP that does the heavy lifting. I've started to run out of SRAM but PROGMEM seems to take care of that.

So, before I get to board layout I wondered what might be a good MC choice in this time where parts are like gold dust? Is the ATMEL328 a good choice?

I'm tempted to make the MC on a daughter board so I can change it easily. Is this a good idea or is there a range of MC that are pin compatible anyway?

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Yeah.. which micro?
« Reply #1 on: December 05, 2021, 07:59:57 pm »
You're already familiar with the M328 and it does the job, so it is reasonable to use that if you can get it. There is a whole family of AVRs with the same pinout but the M328 is the top of that range IIRC so there is nowhere else to go with that. The world seems to be going toward ARM but I've found those to be a LOT more complicated to work with so I've stuck with 8 bit AVRs for most of my projects. Putting the uC on a daughter board sounds like a kludge, I would not bother with doing that, you can always spin a new board sometime down the road if the part you're using gets discontinued but I don't see the M328 vanishing any time soon.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3356
  • Country: nl
Re: Yeah.. which micro?
« Reply #2 on: December 05, 2021, 08:43:19 pm »
I agree with james_s here.

If the ATMEGA328 does the job for you there is hardly any reason to use another uC, especially if you expect to sell low to medium quantities. If you sell multiple hundreds of PCB's then the price of the uC becomes a significant factor.

Adding a daughterboard for the uC is silly. It would mean extra costs for that PCB and a more complicated assembly. Unless PCB area is really important, it makes sense to reserve some room on your PCB around possibly difficult parts, so you can localize modifications if you have to respin the PCB because of parts shortage.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: Yeah.. which micro?
« Reply #3 on: December 05, 2021, 09:59:53 pm »
Use what you are comfotable with.

If you do find out that the 328 isnt cutting it, then finding another processor that is highly arduino compatible might be the best way forward.
So either you could go for a bigger arudino board, maybe something based on a Mega like the arduino nano every (48K flash 6k ram).
Or an newer arduino board that has an ARM processor, but still has the full support of the arduino ecosystem, eg something like the nano 33.
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5903
  • Country: es
Re: Yeah.. which micro?
« Reply #4 on: December 06, 2021, 12:49:39 am »
First check the suppliers and the availability, then decide your options :-DD
With the fab crysis, you'll definitely want a company that runs its own, Microchip should be a good option (Although I'm not  up to date onthis), hopefully you'll be able to source any pic/atmega mcus easily.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Yeah.. which micro?
« Reply #5 on: December 06, 2021, 01:22:25 am »
NXP's LPC ARM Cortex controllers are worth looking at. Simple and reliable devices. Not the cheapest out there but the very few bugs and easy to use peripherals pay back in time saved. IMHO these are a good step up when coming from 8 bit microcontrollers.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: au
Re: Yeah.. which micro?
« Reply #6 on: December 06, 2021, 02:10:33 am »
I'm in the process of designing and coding my first product that uses a micro. It's not large scale, just a cottage business.

I am prototyping with an Arduino Uno, it's that simple, just drive an OLED and send I2C commands to a dedicated DSP that does the heavy lifting. I've started to run out of SRAM but PROGMEM seems to take care of that.

So, before I get to board layout I wondered what might be a good MC choice in this time where parts are like gold dust? Is the ATMEL328 a good choice?

I'm tempted to make the MC on a daughter board so I can change it easily. Is this a good idea or is there a range of MC that are pin compatible anyway?

What size is the OLED ?
You could work backwards, from the RAM which seems to limit you, and choose.
8-bit MCU have simpler manuals, but generally have less RAM than 32b MCUs

The AVR DA/DB series are newer,  have 4K RAM, and are easy to get right now because wider usage is not yet out there :)

 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Yeah.. which micro?
« Reply #7 on: December 06, 2021, 02:54:44 am »
If the 328 works, but you are using less than all the flash, consider the lesser ones in the series to save a little money - ATMega8, 48, 88 and 168, the 48/88/168 all have broadly the same capabilities as the 328 just less memory, the 8 has a compatible pinout but lacks some features I can't remember off the top of my head. 

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Yeah.. which micro?
« Reply #8 on: December 06, 2021, 03:26:30 am »
Quote
Is the ATMEL328 a good choice?
I would say that the 328P is getting a bit "long in the tooth."  A little while ago, there was a NRND on the ATmega328p product page, and now I can't find a product page (alas, it is tempting to blame these on Microchip's crappy web page maintenance!)
If you can use SMT, I'd consider at least an ATmega328PB.  Despite extra features, this has been cheaper than a 328P for a while now.
If you must have DIP, there are the new AVR128DA28 chips, which are currently IN-STOCK at microchip direct.  These have LOTS more memory than a 328, and are likewise cheaper.  But you lose a pin or two, and the HF crystal oscillator.  Or maybe an AVR128DB chip.

 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 334
  • Country: gb
    • Woofys Place
Re: Yeah.. which micro?
« Reply #9 on: December 06, 2021, 08:47:30 am »
First check the suppliers and the availability, then decide your options :-DD
With the fab crysis, you'll definitely want a company that runs its own, Microchip should be a good option (Although I'm not  up to date onthis), hopefully you'll be able to source any pic/atmega mcus easily.

Microchip outsources most of its production these days. The best they can make themselves is 130nm from a 17 year old fab.
source: https://en.wikipedia.org/wiki/List_of_semiconductor_fabrication_plants

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5903
  • Country: es
Re: Yeah.. which micro?
« Reply #10 on: December 06, 2021, 11:12:30 am »
Maybe for newer devices, but I highly doubt they do that for older tech. Having multi-million $ fabs stopped will make them lose a lot of money, specially nowadays.
ATmega328 dates back to 2002! So do a lot of other mcus.
This can be easily seen: Devices that have been +6 years on production are easily sourced, while newer designs (ex. PIC18-Q10 family) are gone and estimated for DEC-2022!
I might be wrong, but that's what it seems to me, so I would stick to older tech.

Even stm32 isn't that edge cutting: they started to use 40nm in their H7 series in 2016.
A lot of their product line still use 90nm, which is a 2003 technology. In 2005 we already had 65nm.
Most mcus don't need such ridiculous high density fab process, their transistor count is low compared to modern computing.
So relying on older fabs process keeps costs down, I guess. These plants already payed themselves years ago.

I keep thinking that this semiconductor crysis is partually faked to riuse the prices.
Yeah, TSMC might be completely overloaded with all phone/cpu/gpu new tech stuff, but c'mon, the're hundreds of fabs using older tech.
Not everything is GDDR5, Nvidia/AMD and 3D-NAND.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline ssashtonTopic starter

  • Regular Contributor
  • *
  • Posts: 220
  • Country: gb
Re: Yeah.. which micro?
« Reply #11 on: December 06, 2021, 05:00:14 pm »
Thanks for the replies! I thought ATMEL328 was bottom of the range I didn't know ATMEL8, 48, 88 and 168 existed.

Interesting though, I just looked at the JLC PCB stock and they have STM32 F6 for $1.05 each 6.6k in stock. While the humble ATMEL328 is $6.04 each and only 3.3k stock. Even the ATMEGTA32 is cheaper at $4.10 each.

Suppose I should use the STM32 even if it's way more than I need, haha. I heard lots of stories about them being unavailable for less than $100 each!

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Yeah.. which micro?
« Reply #12 on: December 06, 2021, 06:00:36 pm »
Wow prices are WAY up on the atmega series, the last time I bought a M328 I think it was under $2. They are an old part, but the fact that the standard Arduino is based on one I think has contributed to them being produced in huge numbers for a long time. Also they're nice parts, powerful enough for a lot of applications and easy to work with.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8172
  • Country: fi
Re: Yeah.. which micro?
« Reply #13 on: December 06, 2021, 07:49:48 pm »
Right now you have to use what is available, and only current availability matters.

Heck, I would force a project into the old and crappy atmega328p if that is what I could get.

If you already have your project up and running on mega328p and you can buy the chip, don't wait any longer, order the parts immediately for the whole production batch. As large batch as you can justify.

Because tomorrow, atmega328p might not be available.

And no one can predict what parts come and what disappear overnight.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Yeah.. which micro?
« Reply #14 on: December 06, 2021, 08:02:24 pm »
Right now you have to use what is available, and only current availability matters.

Heck, I would force a project into the old and crappy atmega328p if that is what I could get.

I probably would not. But that would very much depend on requirements to begin with...

And no one can predict what parts come and what disappear overnight.

That's for sure.
Just from a quick look on Mouser a few minutes ago, it appears the cheapest and in stock MCUs at the moment, at least on Mouser, are the PIC32MM. I would probably take that if I had no choice.
On Digikey, the listing is quite different.
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: Yeah.. which micro?
« Reply #15 on: December 06, 2021, 08:19:28 pm »
I am prototyping with an Arduino Uno, it's that simple, just drive an OLED and send I2C commands to a dedicated DSP that does the heavy lifting. I've started to run out of SRAM but PROGMEM seems to take care of that.
Some of my designs are Uno based, in fact so much so I used to buy Uno boards from China and use hot air to move the parts across to my design... the processor, crystal, usb i/f, etc.  It's not a bad approach if you are hand assembling a few.  Using Arduino Uno as a base design has lots of advantages, e.g. reliable boot loader, easy development system etc.
If you are thinking of moving then you should use the device features to guide your choice, do you need LCD control, in-built USB, WiFi, etc etc.  Recently I've been using ATSAM but that is because they fit my requirements.
Have fun!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Re: Yeah.. which micro?
« Reply #16 on: December 06, 2021, 08:22:05 pm »
You could take a chance on the LGT8F328P - a clone of the 328 with a few extras added.

Arduino-like modules are available on aliexpress. To get the bare chip search for it on alibaba.com.


A random review:

https://sites.google.com/site/ericmklaus/projects-1/lgt8f328p-arduino-clone
 
The following users thanked this post: elecdonia

Offline ssashtonTopic starter

  • Regular Contributor
  • *
  • Posts: 220
  • Country: gb
Re: Yeah.. which micro?
« Reply #17 on: December 06, 2021, 10:23:12 pm »
I've not used an ST32 or really anything other than the Uno. Is there a reason I should not use the STM32F6 for my project? I've seen people compile from Arduino IDE using a library for the STM32 F10 and then program from an FTDI dongle. Can I do the same for F6?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Yeah.. which micro?
« Reply #18 on: December 06, 2021, 11:22:38 pm »
Could you tell us what an STM32 "F6" or "F10" is? Because those references are not right.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Yeah.. which micro?
« Reply #19 on: December 07, 2021, 08:17:39 am »
.
« Last Edit: August 19, 2022, 04:48:27 pm by emece67 »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Yeah.. which micro?
« Reply #20 on: December 07, 2021, 08:22:47 am »
I've tried to get into ARM a few times, but I found them to be so incredibly complex and the software required so bloated and crappy that I've gone back to 8 bit AVR every time. AVR Studio 4 is SO much lighter and more responsive than all of that Eclipse based crap. I'm not a professional developer, life is too short to spend hours just getting an LED to blink when I can do it in 2 minutes with an AVR.
 
The following users thanked this post: elecdonia

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8172
  • Country: fi
Re: Yeah.. which micro?
« Reply #21 on: December 07, 2021, 08:37:15 am »
I've tried to get into ARM a few times, but I found them to be so incredibly complex and the software required so bloated and crappy that I've gone back to 8 bit AVR every time.

It looks that way and I admit you easily get lost here, but this doesn't need to be that way. I write software on ARM processors exactly like I did on AVR. I refused to do anything else; I also refused to go back. It paid off. The amount of code required is approximately 1.5-2x, and there is no bloat. It's not that bad. The key is not to change your workflow in any way. Open up the manual, look up the peripheral registers, write code. Done. Get LED blinking on AVR: set direction register to output. Blink the LED by writing to output register. Get LED blinking on STM32: Enable clock to GPIO port. Set MODE register to output. Blink the LED by writing to output register.

Sure, it's more complex. But not by orders of magnitude. Maybe by 2x. And when you get to devices like STM32H7, it's like 5-10x, but you don't need to start there. I like some things better. For example, I like changing clock source in software even if it results in 2-3 lines of more code, instead of having to understand a special concept called "fuses", how to program them, and how they end up apparently "bricking" the device.
« Last Edit: December 07, 2021, 08:40:30 am by Siwastaja »
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9941
  • Country: nz
Re: Yeah.. which micro?
« Reply #22 on: December 07, 2021, 08:45:33 am »
Most AVR peripherals are pretty much the same across different ATMega chips.
The registers can differ a bit sometimes, however it usually doesn't take much time to move to a new ATMega. Or to get your code running on a different ATMega to what it was written for.

So maybe just decide how much FLASH / EEPROM / SRAM is plenty for all the stuff you want to do and pick a ATMega that meets those needs.

Biggest ATMega mcu I've used myself is ATMega640  (64K / 4K / 8K).
The problem with the bigger ATMega's is that they cost quite a bit verses ARM mcus which are much more powerful
eg, ATMega640 is like $10 and $10 would get you a crazy fast STM32 MCU.
It really depends what matters to you.  If you're just messing around with it then a more expensive AVR mcu might be good, you already know the hardware peripherals and dont need to learn ARM.


Just be aware there are some newer ATMega/ATTiny chips that microchip have released that are NOT the same as the old ones.
eg, ATMega809. They have a different looking datasheet, you program them differently (UPDI), and the peripheral registers are quite different.
« Last Edit: December 07, 2021, 08:49:14 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14192
  • Country: de
Re: Yeah.. which micro?
« Reply #23 on: December 07, 2021, 11:00:58 am »
The older AVRs are relatively similar in the periphery - just not all in all chips, but a similar ADC and sinilar USARTs and so on.
There now newer ones related to the old Xmega series - again a group of rather similar chips, but quites different in the periphery. For higher power / larger memory the newer series AVRs are relatively cheap, especially the AVR128DA... series (around $2-$3 depending on the case).


Currently STM32xx have awful awailabilty. So there is a chance that you can't get the chip you planed for. So one may have to buy the chip before actual doing the design.
 

Offline rpiloverbd

  • Regular Contributor
  • *
  • Posts: 157
  • Country: bd
Re: Yeah.. which micro?
« Reply #24 on: December 07, 2021, 11:06:12 am »
As you made your prototype with Arduino UNO, I think Atmega328P will be a good choice.
« Last Edit: May 09, 2022, 01:41:14 pm by rpiloverbd »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf