We will only be manufacturing about 3,000 boards a year so I was thinking about even jumping up to the new Arm Cortex based chip they are using for the Due, but it might not be possible due to other hardware engineering concerns (I'm a software guy)
Also, it wouldn't hurt if things ran a little faster.
First, you possibly might save space on the Atmega328 by doing some things more efficiently. Without seeing your code it is hard to comment. Second, why? Why if you are making 3000 boards (and presumably shipping them) do you want more space? You aren't going to recall them, are you, and upgrade them all?If you were using the bootloader you can save the bootloader space (at least 512 bytes) by programming them through ICSP (which you would want to do anyway to save time).QuoteAlso, it wouldn't hurt if things ran a little faster.Those other boards won't run faster. However your Atmega328 can run at 20 MHz if it isn't already (change the crystal if you are using one). Again, your code might be able to be improved if it seems slow.
Do you have some proof of that statement?YESSome libraries (eg. digitalWrite) can do things in a less efficient way than ones that know the pins at compile time. Sometimes there is a trade-off of ease of use vs space. Not necessarily. Part of the problem with the digitalWrite() code isn't the flexibility.There better are ways to implement the exact same interfacethat do more at compile time and less at run time.And there are other much faster ways to deal with the i/o in libraries even when the pinsare not constants and not known at compile time - See below.From my perspective some of the Arduino core code appears to be written byfolks that are not very experienced with C code, using the C pre-processor to avoid runtime cycles,or realtime programming.However I don't know that the Arduino libraries are, per se, egregiously slow and inefficient.I laughed out loud, but I believe you are serious.There are many places that are just plain silly and are VERY slow compared to what can and isdone in other libraries.I'll offer a few below.Please supply some proofs in the form of an Arduino library compared to some other library that is much faster and less bloated. One that achieves the same things.
The code can be made substantially faster if the code checked for direction first then dropped down into separate loops.
As far as digitalWrite() goes there are several implementations that are MUCH faster when the values are constants.
Just re-writing/optimizing the lcd library code and still using digitalWrite(), the LCD can be driven around 3.5x fasterAnd then when using a shift register and fewer Arduino pins and avoiding digitalWrite():
1) the screen is very small and few people need fast updates
We've finished our prototype using an Arduino UNO ...