-
Yeah.. which micro?
Posted by
ssashton
on 05 Dec, 2021 19:13
-
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?
-
#1 Reply
Posted by
james_s
on 05 Dec, 2021 19:59
-
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.
-
-
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.
-
#3 Reply
Posted by
lucazader
on 05 Dec, 2021 21:59
-
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.
-
#4 Reply
Posted by
DavidAlfa
on 06 Dec, 2021 00:49
-
First check the suppliers and the availability, then decide your options
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.
-
#5 Reply
Posted by
nctnico
on 06 Dec, 2021 01:22
-
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.
-
#6 Reply
Posted by
PCB.Wiz
on 06 Dec, 2021 02:10
-
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
-
#7 Reply
Posted by
sleemanj
on 06 Dec, 2021 02:54
-
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.
-
#8 Reply
Posted by
westfw
on 06 Dec, 2021 03:26
-
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.
-
#9 Reply
Posted by
woofy
on 06 Dec, 2021 08:47
-
First check the suppliers and the availability, then decide your options
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
-
#10 Reply
Posted by
DavidAlfa
on 06 Dec, 2021 11:12
-
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.
-
#11 Reply
Posted by
ssashton
on 06 Dec, 2021 17:00
-
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!
-
#12 Reply
Posted by
james_s
on 06 Dec, 2021 18:00
-
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.
-
#13 Reply
Posted by
Siwastaja
on 06 Dec, 2021 19:49
-
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.
-
-
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.
-
-
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!
-
#16 Reply
Posted by
ledtester
on 06 Dec, 2021 20:22
-
-
#17 Reply
Posted by
ssashton
on 06 Dec, 2021 22:23
-
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?
-
-
Could you tell us what an STM32 "F6" or "F10" is? Because those references are not right.
-
#19 Reply
Posted by
emece67
on 07 Dec, 2021 08:17
-
.
-
#20 Reply
Posted by
james_s
on 07 Dec, 2021 08:22
-
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.
-
#21 Reply
Posted by
Siwastaja
on 07 Dec, 2021 08:37
-
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.
-
#22 Reply
Posted by
Psi
on 07 Dec, 2021 08:45
-
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.
-
#23 Reply
Posted by
Kleinstein
on 07 Dec, 2021 11:00
-
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.
-
#24 Reply
Posted by
rpiloverbd
on 07 Dec, 2021 11:06
-
As you made your prototype with Arduino UNO, I think
Atmega328P will be a good choice.