News for hackers. Stuff that matters.
Re:The Embedded Rust Book by Matumio on Saturday April 27, 2019 @05:24PM (#19767720)
Is there seriously still a commercial reason to use the ATmega328 (an 8-bit microcontroller with 2000 bytes of RAM) for new projects? I've been working on 3D printing firmware, and it's so easy and silly to reach the limit of this CPU. Been shaving bytes of RAM by reducing queue sizes, running into performance limits even with a few 32bit additions in the stepper loop. That was 6 years ago.

The only semi-valid reason to use this chip IMO is because people want to keep using existing firmware as-is.

Re:The Embedded Rust Book by contingencies on Saturday April 27, 2019 @05:43PM (#19767805)
In fact many embedded requirements are not as complicated as a 3D printer and essentially consist of basic logic and state, sensors and effectors, potentially with some external communication. It may surprise you but 8 bit micros are absolutely fine for this and can serve HTTP at well over a hundred requests per second without breaking a sweat.

If you read the Stepper code for Marlin @ https://github.com/MarlinFirmware/Marlin/blob/1.1.x/Marlin/s... you will see it's nontrivial... bunch of PhDs implementing nontrivial maths in a highly constrained environment. That's cute but not demonstrative of real world concerns. In such cases, you would absolutely throw more hardware at the problem, eg. for motion systems maybe dedicating one 'dumb' MCU per axis and outsourcing planning to a more rational/powerful environment.

Re:The Embedded Rust Book by howard941 on Saturday April 27, 2019 @06:04PM (#19767907)
Cost and temperature. Albeit not the ATmega 328 MCUs in the even more resource constrained ATTINY series go for under $.30 in quantity and run in 125C environments https://octopart.com/search?q=avr%208%20bit&sort=median_pric... . It's going in new products.
Re:The Embedded Rust Book by contingencies on Saturday April 27, 2019 @06:27PM (#19768020)
Only $0.13 for 2000+ ATTINY25-20SU according to http://www.hqchip.com/search/ATTINY.html
Re:The Embedded Rust Book by hajile on Sunday April 28, 2019 @09:48PM (#19775215)
A rather small team of 10 people (with only 4-5 devs) will cost 10K per week at some generic corporation. Let's say your project takes 12 months to make on a beefy processor ($2 per unit) and 15 months on a cheap processor ($1 per unit). That extra dev time to deal with those issues directly costs 120K.

That automatically means you have to be shipping at least 120K units just to break even with those costs. But you are also getting to market 3 months later which itself has huge business costs which means you probably need to be shipping 200K or more units. That's a pretty big number for a lot of embedded device designers.

If you double your chip constraint from $0.13 to $0.26, then that same team must now ship a million devices to break even.

Re:The Embedded Rust Book by bsder on Saturday April 27, 2019 @06:30PM (#19768037)
Um, look that up on findchips/octopart/etc.

It's a buck and change on those--same as ARM Cortex M series.

Re:The Embedded Rust Book by bsder on Saturday April 27, 2019 @06:29PM (#19768029)
> Is there seriously still a commercial reason to use the ATmega328 (an 8-bit microcontroller with 2000 bytes of RAM) for new projects?

For anything commercial? Almost certainly not.

For one-off makers/non-engineers? Maybe. The Arduino ecosystem is really hard to beat for non-programmers.

Re:The Embedded Rust Book by ddingus on Saturday April 27, 2019 @07:51PM (#19768415)
Toys. The 6502 is still being used in them, as well as in many basic UX tasks.

Same for many of these devices. Mature libraries, low cost, ease of use all play a part.

Re:The Embedded Rust Book by burfog on Saturday April 27, 2019 @06:21PM (#19767991)
It sounds like something you might use for the power-on sequencing of a laptop computer. It could manage the battery and wake up the main CPU.

Alone, it's the sort of thing you might use for a kid's toy that you hope to make into the next big must-have Christmas hit. You'd need to make millions upon millions of them, and maybe $49.95 is your target price.

Re:The Embedded Rust Book by Raamakrishnan on Sunday April 28, 2019 @04:45AM (#19770056)
Those microcontrollers for laptop power sequencing have already moved on to Cortex M4s