Main > Everything Else

Arduino?

<< < (2/4) > >>

Howard_Casto:
I like the teensy.  It is arduino code compatable but it is a lot cheaper, so it's better suited for single-use projects. 

I hate to change the subject, but check your PM...It's been a month and a week man, I'd sure like to at least get ftp access back into my site. 

lordnacho:
Was thinking about getting a Lillypad, Halloween just around the corner.  But my wife doesn't agree with lighting up my 3 year old.
Also got a Raspberry Pi in a shoe box on my desk right now, can't get wifi working on it.  Linux :angry:

MonMotha:
I've been using the AVR series of microcontrollers (on which the Arduino an derivatives are based) for quite some time - I think longer than the Arduino project has existed.  I've found the Arduino platform itself somewhat unnecessary.  Most models of the micro are readily available in hobbyist/breadboard friendly DIP packages and can be used with essentially zero external components.  The Arduino does give you a nice little bootloader usable over a serial port or USB with an appropriate adapter (built into many Arduino bases), but its capabilities are somewhat limited.

Atmel has their Dragon platform which can be used as not only a programming head but also for on-chip debug (of the smaller parts), and it's comparably priced to an Arduino.  It's a bit more DIY than an Arduino, but it can do a lot more.

I've never been fond of the Arduino programming "language".  It's a nifty use of C++, but the code you end up generating is often quite far from ideal.  Not a big deal in a hobbyist application, I guess, but when you're trying to cram your program onto the 2k version of the chip to save 5 cents per unit, it makes a difference :)

These days, I really prefer the ARM Cortex-M series to AVR.  I really only use AVR anymore if I want to run something at 5V or have a REALLY small application (e.g. for the aforementioned 2k chip) in low-mid volume cost sensitive application where I just plain don't need the capabilities or pin count of even the smallest Cortex-M0 parts.  AVR isn't bad, it's just getting a bit long in the tooth.  The architecture dates from the late 90s, which is quite a long time in the computing world.  I dunno if anyone has an Arduino equivalent using ARM CM0.  I'd suspect probably, and it may even be bootloader and language (but not binary application, of course) compatible.  That should be doable, at least.

As for the RasPi, it's neat, but mostly because it's cheap.  The SoC they picked is actually kinda crappy to run general purpose Linux on.

Howard_Casto:

--- Quote from: MonMotha on September 12, 2012, 10:14:52 pm ---
I've never been fond of the Arduino programming "language".  It's a nifty use of C++, but the code you end up generating is often quite far from ideal.  Not a big deal in a hobbyist application, I guess, but when you're trying to cram your program onto the 2k version of the chip to save 5 cents per unit, it makes a difference :)


--- End quote ---


What he said.  I was going to mention it before, but I always seem to throw these threads in a negative direction... but since somebody else already has.... :D

The arduino "hardware" is good, if you can all it that... it's normally just your typical amtel chip with some nice i/o pins.... doesn't really have anything to do with the language, but it's marketed that way.  The software is good IF you are wanting to do something very simple, or if you are a little weak on your microprocessor programming (which admittedly I am).  For example, you can turn a avr into a hid joystick with just a few clicks using the arduino interface... but if you want to do anything advanced with said HID joystick in terms of monitoring i/o pins, you are probably better off using assembly or a more "straight c" programming language. 

Luckily it doesn't really matter.  As I've said, the hardware is just generic avr stuff for the most part, so you can put anything on it and the arduino language is pretty good for beginners projects, so you can build up as you go.   

MonMotha:
Honestly, I think I've used straight assembly on an AVR...maybe 2 times?  Once was on an old tiny11, which has NO RAM and is therefore a bit tough to program in C (though not impossible!). The other was for a "bit swap" function; the compiler didn't optimize it very well, and it was in a hot path for me.

Now, I frequently look at a disassembly of what the compiler puts out to see what it's doing.  Often, some minor tweaks to the input (C or C++) can convince it to generate substantially better output.  However, I've only ever actually directly written assembly on an AVR those two times that I can recall.  The compilers for it (well, at least GCC, which is what you're probably using) are pretty good, and the arch was designed originally to be reasonably C-compiler friendly.  Now, you can probably out-optimize the compiler in many cases if you want, but the compiler is good enough that it seems to be rarely necessary.

There is some bare assembly in the C library for the crt0 (setting up the stack, clearing .bss, initializing .data, etc.) as well as optimized implementations of floating point, division, and (for MCUs without the appropriate hardware) multiplication, but you should never have to touch it.

The Arduino libraries, and the simple fact that they're based on some of the "nice" features of C++ that carry runtime overhead, are the major cause of inefficiency when using them.  The overhead isn't outrageous, but carefully written straight C can do quite a bit better and approach the efficiency (speed/size) of hand-tuned assembly in many cases.  The compiler also has some options to do speed vs. size tradeoffs automatically whereas you'd have to re-write your assembly to do that.

ARM is also of course compiler friendly.  In fact, you can bring up a Cortex-M from the bare series with no assembly whatsoever.  The last project I did with an ARM CM4 only had a little inline assembly to make it easier to implement the exception vectors in C (by passing the exception SP in as a parameter to the "function" that implemented it).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version