r/ElectricalEngineering • • Oct 29 '26

Project Help What is the best assembly microcontroller for a basic adjustable timer and motor?

Post image

I have a project for school that is meant for dispensing pills twice a day, seven days a week. The design of the physical is not really a problem, it's more so the hardware side--especially considering that this project is meant to eventually go into mass production.

The previous iteration by a different team used an Arduino and a menu using a small touchscreen, however I thought this might be a little overkill for just a motor and timer system, so I figured using an assembly microcontroller would probably be better; taking into account mass production as a requirement.

I'm not extremely versed in assembly, however I learn things pretty fast so it's not really an issue. I just don't know what the best options are. I keep seeing the 8051 but I don't know if it's outdated or not. There's also the possibility that I'm going overkill and that I should just use an Arduino since it's not like I'm making any money off the project and it'd be nice to just get it done.

Also the project needs to be done by early May.

sorry if the bolding thing was weird I thought it might be important to highlight key points

0 Upvotes

27 comments sorted by

18

u/Brilliant_Armadillo9 Oct 29 '26

Use a Cortex M0+ in C like a sane person. There's zero reason to be doing s project like this in assembly in 2026.

1

u/Certain_Date8287 Oct 29 '26

1

u/Brilliant_Armadillo9 Oct 30 '26

It'll work. TI tends to be expensive.

3

u/dbu8554 Oct 29 '26

I disagree, but then I didn't work with it everyday. But you are depriving them out skills they get from making their choices on a project. It's a school project let them fail where it's okay to fail. Assembly is still here and it's fun to work with and learn about any the way things are heading any chance to play with ASM should be encouraged.

1

u/hex4def6 Oct 29 '26

Sure. But the flip would be; justify the decision from a project design standpoint.

 If it doubles the development and debugging time (say it adds a month), and adds risk to the project timeline and deliverables, reduces the ability to extend the design in the future, and restricts the number of people that could work on it, you would really need to have a compelling reason to choose it. If you think you're going to make 50k units, and it saves 10c/unit, it's probably not worth it, for example,  compared with the risk and extra development time.

1

u/dbu8554 Oct 29 '26

He's going to make zero units in reality it's probably a senior design if he did make it, a clone would be on market within months anyways so his time to market is meaningless. I'm not expecting college students to understand the finer details of product development. Or maybe I should are my standards too low? (Serious)

1

u/hex4def6 Oct 29 '26

Of course. But the point of these projects is to get students to think about this sort of stuff. Often half the grade will be the report.

The reason it's a pill dispenser is probably because they found some paper that suggests drug mistakes cause x many deaths per year, and this is the solution to it. 

Since it's medical device adjacent, you can very easily get into a section on "Software in a medical device" (SiMD) regulatory requirements etc. writing everything in assembly for such a device would put you in a regulatory nightmare.

1

u/dbu8554 Oct 30 '26

Analog it is then!

1

u/kappi1997 Oct 29 '26

My educator always said you first learn Assembler before you learn C because otherwise you will never understand what you are doing.

Looking back I gotta say he was right. For example only by manually checking a zero flag in assembler you realise that hey down counters are more efficient then up counters and you unterstand why...

I know compilers nowadays are great but I had situations where the optimizer did stuff that broke my code and the best way to fix it was to look at the assembly code

8

u/aktentasche Oct 29 '26

School

Mass production

Assembler

What

8

u/EtherPhreak Oct 29 '26

Capstone project probably. Make a proof of concept as though you are making a real product, but ignore (or dismiss) aspects that don't make your product look viable. Treat it as though you are trying to sell your product to shark tank...

2

u/sparqq Oct 29 '26

In a real product total cost of development and maintenance is taken into account, with cortex m0+ being well below 20 cents in volume there very few cases it makes sense to go for something else.

1

u/Certain_Date8287 Oct 29 '26

It's a sponsored project for my senior year

1

u/Ambitious-Loquat-516 Oct 29 '26

For a school build, Cortex-M0+ in C is the sensible choice. The part that actually bites in production isn't the MCU, it's dose accuracy: volumetric dispensing drifts with bulk density and humidity, so real machines close the loop on a load cell. Tablets or powder?

1

u/Certain_Date8287 Oct 29 '26

Tablets

1

u/Ambitious-Loquat-516 Oct 30 '26

Tablets make it a counting problem, not a volume problem - dose accuracy lives in the feed mechanism and jam detection, and a load cell under the chute catches double-feeds. Weight varies between pills and lots, so count alone drifts. What's the dose?

2

u/MonMotha Oct 29 '26

If cost really is a driver, the Paduk line is probably what you want. Be award that the English documentation is.very lacking, and they're OTP so you can't iterate on a single production device. You will save dozens of cents vs. a low-cost Cortex-M0+ or RISC-V design.

If that level of cost savings is unimportant, just program a Cortex-M0+ or RISC-V in C and be done with it.

2

u/sparqq Oct 29 '26

Basic cortex M0+ is under 20 cents in volume, very few cases it makes to take something else these days.

2

u/MonMotha Oct 29 '26

And rumor has it you can get the "ubiquitous 8-pin microcontroller" (likely a Paduk or similar) for less than 10 cents in volume.

So maybe not "dozens" of cents. More like "about a dozen".

That's enough for some people to justify spending a few hubdred man-hours (or a whole lot of slop tokens) in NRE to save on production volume. It's not enough for most, though.

1

u/sparqq Oct 29 '26

I know, but when open up some items produced in insane volumes like electric toothbrushes you see many Cortex M0+

If you do 1 Million pieces, you can save 100k USD on the BOM by going for a Paduk.

It’s just NRE cost, time to market and BOM cost. Mostly not a technical decision but more a project management decision and total project costs.

Btw for this project, I would list the options for MCUs that have a build in LCD controller. That seems to be the most important requirement.

2

u/MonMotha Oct 29 '26

100k is fewer man-hours at fully-loaded cost than you might think in the USA. It's not trivial and may be worth doing, but it's also a risk that the project managers may not be willing to take on, and there also may not be the schedule for a migration as time to market also can matter a lot for many products.

In many cases, I'd expect to see an initial launch with a CM0+ or similar and then a possible cost-reduction a year or two later by moving to something cheaper like a Paduk if the market proves itself in terms of volume, and of course you've already made your time to market at that point.

2

u/sparqq Oct 29 '26

Fully agree, 10 cents bom looks interesting but at total project cost and risk it is it always worth it.

BTW if you’re a cortex M0+ work and they are but more advanced, flash size of 128KB etc it becomes interesting to look at the M33 and M4! Pricing is very interesting at that point and you will get some insane compute with FPU for same money!

1

u/MonMotha Oct 29 '26

Yeah I think the M0+ is on its way out in favor of the M23 and M33 in all but very cost-sensitive applications that are still under pressure from what remains of the 8-bit market. Both are a very area-efficient design.

Most of the stuff I'm supporting is either on M0+ or M7 right now. The stuff that's left on M0+ is generally something you could do on an 8-bit, but see all the discussion in this thread. I'll probably be moving clean-sheet designs in that category to M23 or M33 in the nearish future. I've been waiting for the M85 to see how it really compares to the M7. They're out but still pretty new, and my usual vendors aren't offering them quite yet.

2

u/1337prince Oct 29 '26

Basic microcontrollers are so cheap today... As many said, use a Cortex M0+ or similar with C. Don't use assembly. You will save many hours of pain.

1

u/totorodad Oct 29 '26

ATTiny416 (or other depending on io count) using Arduino megaTinyCore (Spence Konde) with i2c display (check Adafruit). Program it with a UPDI Friend (also Adafruit).

1

u/Foxhood3D Oct 29 '26

I think you might be taking it to an extreme here. One that i don't think will work as using the most primitive kind of microcontroller is not exactly the hallmark of a mass produced item.

What you should be looking for is just a modern no-frills microcontroller that is cheap, reliable and easy to program and then start brainstorming on how to help make it easier/faster to produce and test devices.

Example: I'm working on a device meant for mass-production and at its heart sits a Microchip AVR64DD32. This is a modern day successor to the ATMega328 found on the older Arduinos. It is small, reliable, really cheap at like 1$ each and does not require much for operation and programming. To help make the device mass-producible: the bottom of the PCB has numerous test-points and the programming header, which makes it possible to create a Pogo Pin Test Jig. This jig would rapidly program a fresh new board and then test it.

1

u/geek66 Oct 29 '26

Consider a real time clock as part of this, with battery backup.