So, I’m a recent graduate of an engineering program. I recently got a job doing some firmware development work. Target platform is a flavor of 16-bit PIC. As I’m studying these near-incomprehensible data sheets (why, oh why, did the manufacturer see fit to include the data for 50 different chips in one document? Why didn’t they generate these data sheets programmatically? why isn’t this a bloody wiki…), and trying to get the unreliable compiler toolchain to work, I thought back on the arduino projects I had done in school.
Those arduinos were a lot less cantakerous, and the data on them is a lot better. The IDE is truly multi-platform, where you can compile for about 30 different chips with minimal changes to the source code. In short, it’s a better platform.
Are the various ATMEL microcontrollers a lot of arduinos are based on too expensive? What’s the deal, yo?
It’s all about cost. While people have been building on top of the Arduino to make things simpler to use, the company making the chip you’re using is only providing enough information to get a firmware engineer running and sell chips.
As you proceed along in your career, you will likely find that every individual part of any company’s workshop was bought because it was cheap, at that place and time. One company’s killer find is another company’s albatross. Just because something works better doesn’t guarantee that it will get used; if something else is cheaper, that puts it ahead of the pack. So, you’ll find yourself working in an environment where you have a bunch of ill-matched things that fight like squabbling children in a schoolyard, and it’s your job to make it all work. That’s why they pay you the big bucks.
Compare that to a school, in which you have whatever tools you need to learn how to do something well, and quickly. Even if they don’t have the best tools, they will assign you projects that work given the tools you have available. They don’t have time to teach you how to do dev work in a worst-case scenario.
24H. Got the CCS compiler as well. On the upside, the CCS compiler is pretty user friendly when it works. On the downside, it’s got a lot of obvious bugs in the IDE which makes one skeptical of the compiler itself (especially when your PIC mysteriously crashes doing something that *should *be valid, and the only fix is to just rollback whatever change you just made because you ain’t figuring out why it crashed using the debugger)
Microchip’s sold a lot of those MCUs, so unless you’re doing something very unique with regard to your code I’d doubt the compiler is broken. In any case, if the compiler isn’t generating the assembly you want, just write your own assembly code!
I do almost all my embedded designs with Silicon Labs’ 8051 variants.
Anything that needs more horsepower than that will either go to an ARM-Corext processor or Embedded Linux.
PIC is definitely on the side of providing a variant for every possible feature combination one might want. You can have the chip with the built-in op-amp, or 12-bit ADC, or USB controller, or whatever… but you pay for those features. Atmel provides fewer variants in my experience, and frequently they just don’t have the features you want in the right form factor and price target.
Just as an example, I had a little project where I needed USB support. I needed very few IO pins, and wanted something tiny and cheap. The cheapest/smallest PIC with USB was $1.70. It only had 14 pins, but that was enough. The next equivalent Atmel was like $4 and (IIRC) 44 pins.
Arduino requires a bootloader, which eats into your memory. The smallest PIC has 384 bytes of flash program memory, which is absurdly tiny, but enough for lots of basic stuff. That’s way smaller than the Arduino bootloader, so that’s out right from the start.
I agree that the non-orthogonality between devices can be very frustrating, though PIC is hardly alone in this. For my new satellite project, we upgraded the microcontroller from one MSP430 variant to another. It appeared to be superior in every way. But it had one tiny difference on the crystal oscillator inputs; while both of them supported two separate inputs (XT1 and XT2), the new controller didn’t support a high-speed crystal on XT1. Which is where the crystal was attached on the old board, and we carried over to the new board. So yeah, our fault for not reading the datasheet carefully enough, but annoying.
In short, I share your frustrations, but in the end it comes down to cost–we can’t just throw the biggest microcontroller on every project. Big chips are not only expensive in and of themselves, but they use more power, and more pins means higher board costs.
It’s not Microchip’s compiler, CCS makes a third party compiler. And, I didn’t say there were compiler bugs, just that the IDE itself has glaringly obvious bugs that in no possible world could be caused by anything I did (reporting a file is write protected when it isn’t, and not doing that after a reboot. Failing to recompile source when the button is pressed despite a dirty source file being selected. Failing to restart the debugger properly. The ICD programmer driver just crashing and requiring you to plug and unplug the USB cable to it. etc)
What besides generating incorrect/invalid machine code would you be feeling skeptical about the compiler for? The issues you’ve described with the IDE are pretty common to the kinds of development tools you’re going to be working with – that’s half the fun.
Remember that, as far as your owners are concerned, you are a sunk cost. They aren’t planning to get rid of you because you are useful, but they can’t bill customers for your time, so to them your time is free. Especially if you are salaried and it’s after 5PM, when it really is free.
what’s the deal? generations of engineers have worked on this stuff before you. You don’t have any genius insights just because you’re a recent graduate.
you achieve greatness by standing upon the shoulders of giants, and building upon their work. not by being a stupid kid who thinks he knows everything already because he grew some hair north of his dick.
Meh. I don’t see where he thought he had some genius insight. I have largely the same opinion and have been in the industry for 15 years (and programming for 30ish).
There are reasons why the industry works the way it does, but that doesn’t mean they can’t get their act together in certain ways.
All through college I was told that compiler bugs don’t exist, and that if my code was behaving strangely it was my fault. Well, it’s wrong. I’ve found a crap-ton of compiler bugs over the years, proven through inspection of the generated assembly. Some of them fresh out of college. Datasheets, HW specs, and other stuff are also sometimes wrong. HW debuggers are frequently flaky.
Habeed probably shouldn’t immediately assume that it’s the compiler’s fault instead of his own, but to rule it out immediately is also stupid.
an Arduino is a general-purpose development platform for hobbyists and students to dick around with. it brings along a bunch of shit which won’t apply to a lot of production applications. using an Arduino for a job where a much simpler microcontroller will work is throwing money away.
And that’s the answer he got. Why do you think he asked the question? Seems like you’re the one assuming that he should know everything about the industry when he’s just a fresh college grad.