4 ms·
Right, it's complicated, isn't it? Like, I couldn't (or at least wouldn't) have gotten started on this project if I had to read the ATMega reference manuals fr
by spenczar5 5y ago
Right, it's complicated, isn't it?
Like, I couldn't (or at least wouldn't) have gotten started on this project if I had to read the ATMega reference manuals from the very first step. But I did feel very frustrated that the Arduino "delayMicroseconds" function is so far off from accurate, and I felt frustrated also whenever I looked for deeper explanations of almost anything. It's a very copy-and-paste culture.
I eventually did find programming things more directly to be quite rewarding and worthwhile. My code is still in a ".ino" file, and uses some Arduino stuff, but it's basically built around ISRs in some frankencode middle state.
There's a lot of room for someone to create good tutorials and material for ramping up and out of Arduino. Would have helped me a lot, at least.
- marcan_42 5y agoI wish the Arduino IDE actually tried to be educational instead of just being a dumbed down wrapper around avr-gcc with automatic #includes. There are so many things that could be done... stuff like showing side by side disassembly of functions, with register names displayed symbolically. Or even just basic IDE stuff, like built in contextual function documentation. And then it should have an "export self-contained project" feature that gives you a directory containing a Makefile and all the dependencies to build your .ino, as source code form (and none of the ones you don't use), so you can easily see exactly what is getting built under the hood and can use that as a bridge to working outside the ecosystem. At the scale of 8-bit micros there's no reason not to work with copies of your dependencies, and it's very educational seeing everything in one place (and being able to hack on it) instead of having it scattered in a bunch of global package paths. The frameworks and libraries are useful (if opaque and quirky and underdocumented), but the IDE is just so underwhelming... heck, it doesn't even manage to be a decent text editor. Getting started with Arduino makes total sense, nobody's expecting newcomers to start off with the IC datasheet... but they should be able to eventually read the parts they need and work with it directly, instead of relying only on software abstractions. That's the beauty of these systems.
- dasv 5y agoI have found PlatformIO to be a good step up from the Arduino IDE: it generates a new environment for each project with a sane folder structure, and it is possible to dive into the implementation of any function just with the usual Ctrl+click. It helped me a lot to understand how the Arduino libraries worked under the hood and to make changes in them when I needed it.
- ms-fellag 5y ago>There's a lot of room for someone to create good tutorials and material for ramping up and out of Arduino. Would have helped me a lot, at least. Good news they do exist (at least if i understood your statement correctly), You just need to search with the keywords "AVR", "atmega328", or whichever version you intend to use instead of "Arduino". I attempted to make a simple PLC this summer and these resources were a great help : [book] Make: AVR Programming https://www.amazon.com/AVR-Programming-Learning-Software-Technology/dp/1449355781 https://www.amazon.com/AVR-Programming-Learning-Software-Tec... and this complementary (or introductory) video to the book by the author i believe https://www.youtube.com/watch?v=ERY7d7W-6nA https://www.youtube.com/watch?v=ERY7d7W-6nA [Youtube-videos] A playlist of Cornell's ECE 4760 AVR Lectures by the very chill "Bruce Land" (from 2012) : https://www.youtube.com/playlist?list=PLD7F7ED1F3505D8D5 https://www.youtube.com/playlist?list=PLD7F7ED1F3505D8D5 The course website (labs, exercises and readings) : https://people.ece.cornell.edu/land/courses/ece4760/index_2015_atmega1284.html https://people.ece.cornell.edu/land/courses/ece4760/index_20... Homeworks : https://people.ece.cornell.edu/land/courses/ece4760/homework/oldhomework.html https://people.ece.cornell.edu/land/courses/ece4760/homework... Labs : https://people.ece.cornell.edu/land/courses/ece4760/labs/oldlabs.html https://people.ece.cornell.edu/land/courses/ece4760/labs/old... Although the course was centered around an atmega16 or something? i really don't recall sorry but the knowledge i gained was invaluable and easily transferable to a 328p. Fundamentals of Microcontrollers - Arduino bare-metal breakdown (A playlist of a guy "Mitch Davis" exploring an atmega328 barebone and using tools like AVRdude etc..) https://www.youtube.com/playlist?list=PLNyfXcjhOAwOF-7S-ZoW2wuQ6Y-4hfjMR https://www.youtube.com/playlist?list=PLNyfXcjhOAwOF-7S-ZoW2... Atmel Programming Tutorial (by Chris Dahms ) https://www.youtube.com/playlist?list=PLoLaqVexEviMZu55Y4JO66b4xIv5K-D1L https://www.youtube.com/playlist?list=PLoLaqVexEviMZu55Y4JO6... Hope this helps.
- spenczar5 5y agoThanks; these are helpful but not quite what I meant. I was thinking of something that speaks in terms like “you have an existing Arduino project; how do you migrate off of Arduino and to gcc-avr?” In other words - explicitly build off of what you learn from Arduino, rather than starting from “scratch.” Maybe that’s harder, though.