Questions on a custom PCB with Arduino compatible MCUs

Hey all,

I am using the Arduino ecosystem for my project. I am building a custom PCB and would like to include the MCU in my PCB. I have read some tutorials online that show how to do it. But, I'm still unclear and have few questions.

The MCU will be responsible for turning a relay on for sometime after two buttons are pressed. It must also control the LCD and print corresponding messages.

  1. I see that the Arduino Uno uses a ATmega328P which comes in a DIP package. I am considering the ATmega328PB-MU which comes in a QFN package. There are different versions of the ATmega328PB and I'm not able to find the differences between them. Can I go with the one that costs less?

  2. I came across the new ATmega1609, which claims to offer more performance than the ATmega328 and costs less. MegaCoreX brings Arduino support for ATmega1609. The library is new, can I use it in production? How reliable will it be? Is the ATmega1609 a good replacement for ATmega328?

Thanks.

you could also use atmega328p au right ?

m_k_akash:
you could also use atmega328p au right ?

Yes, but they cost more than ATmega328PB-MN.
I'm more inclined towards the ATmega1609. Just wanted to make sure it compatible and can be relied upon.

if price is a issue checkout ATmega8a au which is way cheaper. all this depends on your project like, whether it needs more i/o pins, does it need more storage, does it run on battery etc. As far I know I think your project is not that complicated. If your intending to commercializing your project then you should consider the manufacturing price and build quality and durability of the product.

m_k_akash:
if price is a issue checkout ATmega8a au which is way cheaper. all this depends on your project like, whether it needs more i/o pins, does it need more storage, does it run on battery etc. As far I know I think your project is not that complicated. If your intending to commercializing your project then you should consider the manufacturing price and build quality and durability of the product.

Thanks. Yes, those are my main concerns. My project won't run on battery. I wont be needing more I/O or storage. The MCU will have have six switches and a display connected to it.

Thanks for recommending the ATmega8a. Does the arduino core ecosystem support it? What do you think about the ATmega1609, it's way cheaper than the ATmega328 or ATmega8a. It has a library to add it to the Arduino ecosystem. How reliable is it?

yes of course you could use the atmega8a au with arduino ide, almost any avr chip can be use with arduino ide and atmega1609 also could be used with arduino ide but since its its new I havent used it, thats not a issue, you could chose any of them. You could exclude the external oscillator further and use internal oscillator if not much processing power is needed. You could chose any MCUs there are many more avr MCUs than we think.

m_k_akash:
yes of course you could use the atmega8a au with arduino ide, almost any avr chip can be use with arduino ide and atmega1609 also could be used with arduino ide but since its its new I havent used it, thats not a issue, you could chose any of them. You could exclude the external oscillator further and use internal oscillator if not much processing power is needed. You could chose any MCUs there are many more avr MCUs than we think.

Thanks a lot. How does the ATmega1609 fair when compared to the ATmega328? Do you think the MegaCoreX library is stable enough to be used on production? Are there any other ways I can use the ATmega1609 with the Arduino IDE?

How does the ATmega1609 fair when compared to the ATmega328

its somewhat similar to atmega328p. the 328p has 32k flash, 2k sram and 1k eeprom, 1-UART, 2-SPI, 1-I2C,1 Input Capture, 1 CCP, 6PWM, 2 x 8-bit, 1 x 16-bit timers and has 16 channel, 10 bit adc whereas 1609 has lower memory like 16k flash, 2k sram, 256 byte eeprom but has more i/o pins and has more other hardware components like 4-UART, 1-SPI, 1-I2C, 16 Input Capture, 11PWM, 5 x 16-bit timers and 16 ch, 10-bit adc.

Do you think the MegaCoreX library is stable enough to be used on production

As I said I havent use atmega1609 so I dont know about stability, you could always check the github issues and then come to a conclusion on it.

Are there any other ways I can use the ATmega1609 with the Arduino IDE

you could add your own boards to arduino ide here is good tutorial on that. You shoudl test your product thoroughly and think about all the problem that affects the functionality of your product and once you have solved all you could manufacture it

m_k_akash:
its somewhat similar to atmega328p. the 328p has 32k flash, 2k sram and 1k eeprom, 1-UART, 2-SPI, 1-I2C,1 Input Capture, 1 CCP, 6PWM, 2 x 8-bit, 1 x 16-bit timers and has 16 channel, 10 bit adc whereas 1609 has lower memory like 16k flash, 2k sram, 256 byte eeprom but has more i/o pins and has more other hardware components like 4-UART, 1-SPI, 1-I2C, 16 Input Capture, 11PWM, 5 x 16-bit timers and 16 ch, 10-bit adc.
As I said I havent use atmega1609 so I dont know about stability, you could always check the github issues and then come to a conclusion on it.
you could add your own boards to arduino ide here is good tutorial on that. You shoudl test your product thoroughly and think about all the problem that affects the functionality of your product and once you have solved all you could manufacture it

Thanks a lot :slight_smile:

You are welcome, all the best for you project

Easiest way is to use an existing Arduino board as model or a starting point. If you use that same CPU everything will be easier. Check that your serial port and everything you plan to use are on the same pin as they are on the Arduino board. Then you can even test your program before ordering your boards.

This way you'll have a bootloader, so it will be easy to modify your SW later.

LMI1:
Easiest way is to use an existing Arduino board as model or a starting point. If you use that same CPU everything will be easier. Check that your serial port and everything you plan to use are on the same pin as they are on the Arduino board. Then you can even test your program before ordering your boards.

This way you'll have a bootloader, so it will be easy to modify your SW later.

Yes, that's what I am planning to do...

What are the other things that I should take care of when using a Arduino for a commercial product? Like safety, interference reduction, etc?

security of your code is important or anyone can replicate your product

The 1609 has less program memory than a 328, and last time I looked, was only a few cents cheaper than an atmega4809...
The 4809 is used on Uno WiFi 2 and Nano Every, so it’s slightly more officially supported...

ismyname:
Yes, that's what I am planning to do...

What are the other things that I should take care of when using a Arduino for a commercial product? Like safety, interference reduction, etc?

ESD or static sensitivity I think is important too. I use 10k +100nF in every input, also outputs could need a over voltage protection, diodes or https://www.digikey.fi/products/en/circuit-protection/tvs-diodes/144

You propably know all this, but most of the part in an Arduino board are for getting power from either USB or from power connector. I use something like this and save space https://www.digikey.fi/product-detail/en/recom-power/R-78E5-0-0-5/945-1648-5-ND/2834904 .

What is important is to get UART and other special pins same way as in Arduino board. Then Arduino libraries will work without problems

As you can see from my long answer I like designing my own boards.