I am a graduate of the specialty "Microelectronics and semiconductor devices." During my years of study, I developed many devices on microcontrollers, participated in contests with my team and was the head of the embedded systems laboratory. I have a dream - to create conditions in my country for the development of robotic systems and there is a plan to achieve it, one of the points of which is to participate in the training of a large number of professionals in this field.
I am happy when future engineers create their devices and get upset when I hear someone talking about using Arduino in them.
This is not my first article on this topic: I have a desire to write one immediately after reading the phrase about the endless possibilities of the platform in the DIY topic on Habré. I have a desire to write about the true price of parts after reading the article about the purchase of the designer for $ 200 almost nothing (forgive me, I forgot where I saw).
')
The point here is not at all that I believe that the Arduino is a bad idea. On the contrary - thanks to the platform, many have learned the world of microcontrollers, have learned that even a person without special education, with minimal knowledge in programming and with a lack of knowledge in electronics can assemble a small cool device.
Thanks to the Arduino, a lot of projects saw light, gathering dust in the memory banks of the brain of their authors.
Frankly, I sometimes used the code written for Arduino myself (for example, the InvenSense company produces the
MPU6050 module, which was run normally only by
Jeff Rowberg ).
I despise those people who, having discovered the world of microcontrollers for themselves, did not bother to look around in it and those who brazenly profit from such people.
An Arduino fan student from the IT department came to our lab (and worked with us). The man spent a lot of money on the purchase of the * duin themselves and the modules to them. I watched, not without regret, how the future (I still hope) creator of robotic systems could not start the PWM of the desired frequency, although he had wound a lot of “flight” hours of work with the platform.
So, this student showed me a “battery meter”, or something like that. I specifically found it now on ebay, where it is called “
High Sensitivity Voltage Sensor Module -Arduino Compatible ” and
sells for $ 8.58 . Here it is, in the picture:
By the way, the central wire that is “+” - it just hangs in the air - everything is done for maximum convenient connection of a simple voltage divider, the red price of which is 2 cents for resistors and 20 cents for the plug - this is if you buy at retail.
This is not the only case of deception of our brother, below I will give a few more. Now, for fans of structuring, I will write the main drawbacks of the Arduino.
- Libraries. I love libraries - I write my classes and functions, or I use the well-written code of my colleagues - this significantly speeds up my work. Arduino libraries are easy to learn, but that’s where the pluses end. For example, you can form delays all your life with the help of delay-functions and not have the simplest idea how the timer works on the microcontroller - all the Arduino libraries consist of such minuses.
I mean that the timer and other peripherals in the microcontroller are implemented to compensate for its single-threading interrupts. And people spend processor time decrementing an unused variable.
The division and use of floating-point numbers on eight-bit AVR controllers is something that should be resorted to only in the most extreme cases, when it is impossible to do without it.
A string is not sent to the serial port using a state machine with a lot of empty wait cycles for the buffer underrun flag in the main program body — again, this is a waste of resources — there are interrupts.
Yes, in the Arduino, you can enable interrupts, but who does this?
On Habré there is a good article on how to speed up the work of the Arduino libraries . It honestly struck me that even the defense industry workers have slipped to work with the platform, but it can give general ideas about the speed of these libraries. - Development environment. Microcontrollers can be programmed in IAR, Eclipse, Keil and other less well-known environments.
And IDE Arduino is cross-platform and with syntax highlighting.
- Power. Moreover, both hardware and dissipated. The development of any embedded system begins with the choice of components, depending on the required functions. Atmega328 (or 2560) is too powerful for blinking, and too weak for creating a real-time system with image processing algorithms.
- Dampening programmers. Programming the microcontroller does not require special skills and abilities, but you still have to spend a couple of hours and study the work of several peripheral devices, thereby stretching your brains. Why do this if you can write something like analogRead and digitalWrite?
- Price. There is already a question not only to manufacturers of Arduino and clones: prices for AVR controllers are generally too high. For example, the Atmega2560 will cost you $ 10. For the same money you can buy two STM32F103. It happened so because people are too lazy to learn other controllers, and there are a lot of materials and examples in this circle.
At Hobbyking, where fans of various models are cheating as well as in other stores of arduino fans, the usual capacitor was sold somehow, under the guise of some kind of filter. I could not find it now. With a three-pin plug, of course. Only 3 dollars.
Arduino Compatible Mini Motor Speed ​​Counter Sensor AVR PIC - is replaced by a LED and a phototransistor connected to the central controller and twenty lines of code. It is not
worth 7.98 .
AVR ARM Arduino Compatible 2 * 4 Matrix Keyboard Push Buttons are
just buttons that can be purchased for 10 dollars per dollar.
There is one device in the world that I hate more than Arduino - this is
mbed . Its developers took the LPC1768 controller (there is also a LPC11U24), soldered it onto a board with two stabilizers (I won’t talk about the quality of the PCB layout), put half of the legs out (the second half is not connected, which is very annoying) IDE (however, a little better than the Arduino, although it requires an internet connection) and sell it for $ 64. Sorry, but this is quite.
What to do if you suddenly decided to stop marking time and start learning microcontrollers?
- On Habré there was a cycle of articles “ STM32F1xx - we are curing arduino dependence together ” - the articles are good and quite understandable, it’s a pity that the author abandoned writing new articles.
- All newbies are sent to easyelectronics.com, where comrade DIHALT published an AVR microcontroller training course .
- “ Designing Applications on 68HC12 / HCS12 Microcontrollers Using the C Language ” S.F. Barrett, J.J. Pak is a super book that helps you understand the basics of C programming for microcontrollers. The only problem is that you are unlikely to get a Freescale microcontroller, so the examples will have to be used to port the examples to AVR, PIC, MSP430 or any other controller.
- Before buying anything for your devices, read about it at least in Wikipedia - perhaps the same item can be bought cheaper if you call it differently.
Do you know what's weird? Among Arduino users, there are even those who despise Apple for their “focus on the
near- busy-for-such-trivial user”.
I do not want to offend or persuade anyone. But I will be glad if at least one person who has read the article up to this point changes the Arduino to a simple microcontroller - perhaps it will turn out to be a good developer of embedded systems in the future.