EDIT – TL;DR clarifications: We’re still using the same 328p processor that we’ve used from the beginning, but now in a standalone configuration. The processor hasn’t changed. The speed increase is due to new faster 20Mhz crystal.
EDIT 2: Nope, it’s not overclocked. We’re utilizing the 328p’s full capabilities as intended by the manufacturer.
Edit 3: Question: “Why did you run 16Mhz before?” Short answer: Arduino IDE limitations. For the long answer, see below.
The Standalone 20Mhz Board (v0.1.7)
Assembled and tested
Hardware has just a few loose ends left to polish off, but finally works as intended. No more jumpering to breadboard circuits to work around issues. I imagine that v0.1.8 will be the “final” pre-alpha version before rolling over to the “0.2” designation in the alpha stage.
Firmware slowdown: The Arduino breakup
NanoEFI is currently moving away from the Arduino IDE. If you’ve worked with Arduino before, then you know that the platform is outstanding for beginners and great for quickly hashing out early development. However, once you pass a certain point some of the platform limitations begin to present design problems.
For example, Arduino boards are limited to 16mhz, even though the processor is capable higher speeds. In our case, the 328p processor can run up to 20mhz.
Also, the Arduino libraries aren’t optimized for speed. The Arduino system’s ease of use (and super compatibility) come at a cost to speed and timing accuracy. This isn’t a bug though. It’s just a necessary part of what makes Arduino great for the uses that the developers intended.
We’re going to need the full 20mhz for recent features. This will also raise the maximum engine speed supported. And hopefully help overcome the lack of hardware timers for possible 2 and 3 cylinder support. The decision was made to switch to a standalone board-mounted processor setup.
Transitioning the hardware circuitry in v0.1.7 was straight forward. Studying the datasheet is absolutely critical, as usual.
However, Arduino core libraries aren’t natively compatible with 20mhz operation. And not easily converted. The core can be modified, but real world implementations appear unproven. Forcing the Arduino system to perform so differently than designed will likely produce undesirable results.
Instead, I’m spending this time re-implementing the firmware in the comparatively leaner Atmel IDE. Although not as simple to code, this allows for design flexibility without hacks, and full native access to the processor’s resources.
In true divorce fashion, only half of my original code from the Arduino was usable in the transition. Oh well. I needed to restructure recent developments anyway, so this isn’t really a loss.
Hello Atmel Studio!
This only affects the NanoEFI core, not the Developer IDE concept or extensions!
Familiar Arduino functions will be supported in the NanoEFI IDE. So you will still be able write your code in “Arduino” style C/C++ if you prefer.
See the core values update for more info about custom extensions.
If you want more updates, be sure to like, share and comment on the NanoEFI Facebook page.
With a bigger audience, I can prioritize communicating more often. Help get the word out, and share this project with your friends! 😀