EEVblog #45 – Arduino, PICAXE, and idiot assembler programmersPosted on November 21st, 2009 60 comments
Dave checks out what all the fuss is about with the Arduino, contemplates the PICAXE, and cuts loose on die hard assembly language programmers.
All with no more silly 10 minute youtube time limit.EEVblog - Official Releases, EEVblog - Podcast arduino, atmel, microchip, microcontroller, picaxe, rant, review
Arduino, no worries, we share pronunciation.
due = 2 mila = 1000 nove= 9
For poetry and artistry the Italian has a sweeter sound than two thousand nine and isn’t so clininical as 2009 which is what I refer to it when I’m feeling tired and confused.
The Arduino duemilanove (which I assume means “2009″, at least seems that way) is pretty cool, but the programming kinda irks me. I mean, to set data on output ports, it seems to me like you have to set pins one at a time, feels painful. I’m not sure if it synchronizes consecutive port bit changes when it compiles, but still.
Anyways, I think assembly really has it’s place in low-end chips, but I’d stay away from low-level languages with powerful chips, even the AVR. The main reason I use assembly, despite being slow to write, is that I’m not great with C/C++ and it just makes more sense in my mind doing the individual register changes and instructions for modifying data. My brain just thinks in assembly better than it does in C.
Although Arduino uses C it does not have proper equivalent of C instruction to change several pins at the same time. But you can still use C instruction to do this.
Google for more information with keywords like “avr gcc tutorial”. Here is nice one about port manipulation:
Btw Dave… Although I already knew everything you said it was still great video to watch. Maybe except that nose in background. What happened?
“Maybe except that nose in background.”
Yeah, that honker bugs me too.
John… One of the reasons Arduino is so great is that you can squeeze anything in C or even assembly when you need it. Don’t hesitate and use it to do stuff that Arduino is not doing with its own libraries.
Arduino lacks all sorts of usefull instructions, because wiring/processing (which arduino is using) was made for artists, not engineers or even hobbyists who know or like to know what port or pin manipulation is
Arduino forums and google can provide with tons of useful tips.
I agree with KuchateK, the Arduino was developed for artists to use.
I use a lot of Assembler, due to the fact that I am wringing ever last ips out of the AVR, I am currently trying to get USB and DMX512 to work on one of the AVR USB chips. When you have a 250K serial port pumping out data, you do not have much time to do anything else….
I can picture Dave at work:
Dave “Matt, pass me the ardrino”
Matt “I am using it, will be finished in 10 minutes”
Dave ” No Wucking Furries” (this is aussie slang for swearing in public, to get the real words, swap the W and F
Sigh the world is filling up with time wasting development kits (my collection includes:
4x AVRISPII (when I am running a tight development project if it dies, it is easier to grab another off the shelf
1x JtagICE MK II
1x Nano Board (Altium FPGA development kit)
1x Nano Board 2 (Altium FPGA development kit)
1x Ti MSP430 Devkit
1x Memec Spartan III FPGA dev kit
And that is all the devkits that stick out
Wonderfull hear you David try to say Duemilanove
(I’m italian, so…)
Anyway… Duemilanove means 2009, and of course Arduino is a strange name also in Italy… In fact was a namem, really used for people in the past. But right now no more.
And to conclude think about… My grandfhater was called Arduino!!!
great to see that you like the Arduino. I used them a lot and they are really, really fantastic.
And there is another reason for it’s success. It’s also very easy for pure software developer (as I am) to get a grip on hardware projects. For us the programming is not a problem, but all these wires, LEDs and voltages scared us. Arduino with decent examples makes it much easier.
BTW: I really like your blog. Only one thing if I may note that, an entry in your blog is a post, not a blog
There goes the basic stamp!
I loved the end about the assembler programmers. A while back we had one come in to an ETA meeting to talk about Micros. He was saying the same thing about it.
It was really annoying.
I myself love the C language.
Your blog is awesome! I frequently check it in hope for a new post.
I think you would make a really good electronics teacher.
“idiot assembler programmers
Great post Dave,
I think the Arduinos are pretty cool, but for a beginner looking to get into design I think a good demo board and some comprehensive example code is a much better starting platform to make the jump to designing your own hardware around a micro.
Secondly, I think assembly deserves a bit more credit. Even a C guru should know some assembly to know what is going on inside the micro a little better, especially for arithmetic. Programming in C is much easier, but write some assembly to do some basic integer division or float multiplication and it will improve the way you write your C code.
Awsome blog, Dave
I am a student and use the arduino, because it is so easy to interact with all cind of hardware. It have realy lowerd the bar for geting in to electronics.
The arduino are actualy in space, it interact with some gyros on an satalite. It is on a costom board, but uses the arduino language.
Great blog, keep up the good work.
How do you feel about assembly language as a learning tool? I have only used basic stamps in the past, but am planning to buy a new microcontroller setup soon.
I was thinking about going with PIC so I can use assembly to learn the lower level hardware.
Does PIC have a benefit over AVR/Arduino in this respect?
I really liked this episode. It has been years since I have kept up with a podcast to the point of asking “Is a new episode out yet??”
Keep them coming!
Nice review of this design kit, I might get one myself. I just … can’t stand how they call program “sketches” though. Very artsy fartsy.
Gotta say, I’ve gotta disagree regarding Assembler (go figure!). Quite often, some things can only be done on certain micro-controllers by using assembler. Is it a sign of madness to use these instead of using higher speced ones? Not necessarily, if you’re producing 2 million units of a product… or trying to pump out USB commands on a unit not design for it (see for example the VUSB project).
Nice to see the EEV blog videos all in one 20 minute span!
I too like the arduino platform mostly because I get a wild hair to develop some crazy contraption for Halloween or just to scare my cat and I don’t want to spend hours working on discrete electronics to get the project up and running. One could do it that way and have a cheap, functional and low power solution but then you spent way to much time.
For such projects I can grab my arduino or sanguino dev board and have a silly string shooting Halloween spider ready to scare the kiddies in just an hour or two. See said project at: http://www.toddfun.com
I really can’t say enough good things about the arduino. I once started with the basic stamp but found them expensive and quite limited. Since starting with the arduino I have already purchased blank Atmel chips and programmed simple projects for just a few dollars using a homemade ISP parallel port cable. You can’t do that with the basic stamp. Maybe with the PIC you could do that too, but I love the open source hardware, software and community surrounding the arduino. I think that plus the tons of examples you can find all over the web for projects people have done is what makes the arduino platform such a phenomenon.
Just saw this latest blog entry on the Arduino and had a thought pop into my head while I was watching.
I’m currently in school and working on my tech thesis project for graduation now, but it’s fairly complicated so I’ve started early. The project itself is a remote-controlled, self-balancing platform (think Segway without the handle) and I’m going to use a PIC16F877 for the final design. But getting the code up and running initially with the accelerometer and gyro and controls is tricky, so I’m actually starting with an Arduino (the Freeduino SB) to help me get some headway.
That’s the biggest noticable difference, in my opinion, between the Arduino and other mircos, that it’s sometimes easier to get something up and running, even if it’s not the most elegant solution. So for someone prototyping a project or starting off, I think they’re great tools, and once you’ve got a handle on it move it to a more appropriate micro that suits the application.
Anyway, thanks for this blog, it’s really interesting and I think it helps alot sometimes!
Hahaha… I am an ASM hobbiest programmer. I would never recommend anyone going down that route. I thought about getting into microcontroller and the arduino caught my eyes. The reason was that one can program in C + open ware.
Life is too short to be wasting time in ASM.
I love ASM because it learnt me the inner workings of the CPU. I loathe ASM because it takes so much damn time to do anything really useful with it… Still it’s fun and every one should do a bit of it at least once in a lifetime.
I just bought Arduino last Friday. Was playing around with it all the weekend. This morning I was reading my daily web sites and looking to read anything more about my new toy. And guess what? It was funny to find your video Just what I was asking for ))
Thank you for your blog!
By the way – have you seen EasyPic 6 kit? And MikroBasic development environment? I was uning their products for 6 years, but finally decided to move to Arduino. It’s my level of complexity. I become too tired with PIC trying to make my custom boards work instead of just making my ideas real. But anyway – I think that http://www.mikroe.com is worth to review.
Wait one second… Let’s not throw out assembly all together now. It’s important for new programmers to at least be familiar with assembly and the architecture of the chip they’re using. I agree that C is easier, but let’s not ignore the basics.
Sorry Dave, just saw your earlier reply. Agreed.
I don’t think one can entirely dismiss the differences between assembler variants by just using C. The quality of compilers is often dictated by the design of the assembly. A processor with fewer registers will, for example, result in a lot more register spills in compiled code. Many of the things that make assembler programming easier (orthogonal instruction sets, high numbers of registers, fewer special purpose registers or restrictions on registers) also make for better compilers.
If you’ve ever played Transport Tycoon or Railroad Tycoon (old geeky PC games) you might be interested to know that they were written almost entirely in assembler (http://www.chrissawyergames.com/faq3.htm). Madness!
Yeah nobody realy uses asembler these days, still useful to know some tho.
Oh and speaking of MCUs there is a realitvely new company called XMOS that has some inovative chips. They use a new kind of acrhitecture that makes the CPU multitask on its own in hardware and even alows multiple chips to be linked together for extra umph.(They do make them up to 1600MIPS per chip)
Hello Dave, I have been using the arduino for about 2 yrs and I am a fan, everything you said about it is true. My question is, if you were developing a product to be released would you feel confident in using an arduino??
As an old fart [programming for 40 years, electricity/electronics for 12-14 years longer [my official start was with a couple of dry cell batteries, some wire and two telephone handsets from my dad], my view is that you work in whats most comfortable for you – I do quick and dirty data manipulation on a PC in turbo basic, PIC 16/18 programming in assembly for interrupt handlers and if there is math needed, either an assembly language set of routines with macro calls, or when there’s more than 4K of code space, let my associate [a 'C' guru] interface with defined calls to my code. But the bottom line is – when it dosn’t work, you have to be able to understand the assembly to see how the ‘C’ compiler implimented what you wanted it to do.
thanks for making me laugh about the utmost shortest way off MAKING THINKS (redundant emotions around surely respected questions as ” what language is the best….yada yada ” CLEAR enjoyed this approach of educationally slapping faces and foci just using language to invite or propose to the domain of schorter abstractions love it
Thanks for that video, really enjoyed it.
The “assembler dickheads” really speaks for my mind. The worst thing are that type of guys who tell every newby to first earn assembler before starting with microcontroller. Really, i have seen that a lot. Thats good that the arduino sets a lower entry lever for that great hobby. Tell someone who never has written code to first learn assembler is the fastest way to make them hate controller.
I came to the conclusion that many die hard microcontroller guy hate the arduino cause it takes away a lot of their “magic” to “master” the controller, because now basically everyone can start using them. And thats a good thing.
arduino has a pretty impressing bang for the buck. It might have it’s limit, but that can take a newby years to find them.
Just wanted to say thank you for your great blogs, particularly this one which has turned me on to the Arduino.
I was getting pretty frustrated with the slow pace of my course and really wanted to get stuck into some real programming (so to speak). Hence I ordered one and I’m hooked.
Thanks and keep up the good work!
Hi Dave, I noticed that your videos now have a different intro. “Hi, welcome to eev blog, …”
It does not sound it used to sound!
You now say it more calmly. I love when you were more energetic and said the same thing more quickly and with more power like: “HI, WELCOME TO EEV BLOG, I AM YOUR HOST, DAVE JONES”
You should consider adding the old intro audio back, or changing this one to more energetic one!
Otherwise it does not sound like you anymore! Sometimes I even start wondering if it’s you or not!
I want to let you know that on 7th of January you can get $100 free of hardware (for only the cost of shipping) from sparkfun.com:
Archaic dickhead here.
I’ve programmed micros in both asm and C. The gcc compiler (in this case, also known as winavr) is very good at optimizing C code. Though I have done quite a lot of assembly, I now use C quite a lot due to how well gcc does at optimizations.
As for the arduino, I don’t feel that it’s “high level” at all. It hides the complexity of the hardware from the programmer so that the not so educated masses can get something running without pulling their hair out. Don’t get me wrong here, that’s a good thing(tm). We need more innovation in the open source hardware field and if it takes a simplistic programming environment to get people to experiment, then I would encourage anyone and everyone to play around with these boards.
BUT – do not go around saying that if you can program an arduino that it is the resume/job seeking equivalent of an embedded systems programmer. The processing environment of the arduino hides many hardware details that a professional embedded systems engineer needs to know about. Also, if you are producing a product for sale on the open market, YOU CAN NOT USE the arduino environment without also being required to produce an open source product. Anyone trying to get a job as an embedded systems engineer based on your recommendation in this video is headed for failure before the finish their first week of work, imho.
Wrong, Arduino core and libraries are released under the LGPL, which do not require to release your source code.
Fair enough. BUT – are you going to defend that position to your boss and co-workers?
I don’t think so. You’d be laughed out of the conference room.
Do you know that’s there’s people around ONLY using strange words that you can’t pronounce? That’s what you english speakers call a foreign language!
There is a reason why C/C++ is taught at Universities for programming MCUs, it’s simpler, and personally I prefer it.
The use of assembly language however is not restricted to dick heads, I agree the attitude of the ones which are on the internet portray is stupid however.
Assembly is a good thing to learn, but programming large/complicated projects with it is not worth the bother.
Also, you can’t deny that somebody who programs in assembler has a greater microelectronics knowledge and knows a lot more about what’s going on with the hardware.
Nice blog entry Dave; I absolutely agree with your assessment of the assembler Nazis. Of course there is still a place for assembly programming and having a good understanding of what’s going on at a machine-code level is not only useful and interesting but sometimes essential. But full-on writing of a project in assembler is total madness unless there really is no other option.
I think there are a number of reasons why some people insist on assembly programming:
1. Elitism; it makes them feel that they are at the top of the programming food chain because of the innate complexity and black-magic like perception of assembly programming.
2. Purism; the final project will likely be smaller and faster.
3. Controlism; the programmer has complete control and doesn’t rely on the compiler generated code or library code.
4. Familiarityism; some people just don’t like change, new fangled technology and/or moving from being an expert in one thing to a novice in something new can be daunting and scary. Also, old-school assembler types will likely find adapting to new programming paradigms and methodologies hard.
One point regarding why Arduinos/ATMels have exploded in popularity that you didn’t really emphasise was that the tools are FREE and professional quality! Unbelievable! You get a professional quality IDE and compiler for nothing! How cool is that? Within half an hour and $40 you can be producing professional quality embedded systems. My current project is 400 lines of C-code (with comments, blank spaces and preprocessor directives) compiles to 1000 bytes and runs on an Attiny13a at 20 mips, wow!
The Atmel microcontrollers are such incredible devices; fast, versatile, rich with features and cheap. Did I mention 20 MIPS?
Keep up the good work.
Great video blog David!
All you folks got me going – Assembly, C, Arduino, Finite State Machines, and IDEs:
I’ve been an embedded programmer for a few decades. I also do hobby microcontroller stuff at times – but hobby work has always been a horribly inefficient pain in-the-ass compared to using “real” tools at work (O’scopes, emulators, C-source-code level IDEs). I once even made my own assembly source code IDE in DOS for the Motorola 6801 micros (so I could single step with original source with comments and watch-window variable names)
The thing about Arduino, and in my opinon the reason behind it’s success, is that it is a complete package. You get programable chip with the interface PC built in and it’s easily connected to whatever you want to connect it to. You don’t need to find or build adapter to program it, you don’t need to design and build PCB to mount it on. So it’s hardware is very beginner friendly and powerful enough to be useful. And it’s not terribly expensive.
Programming in assembly code is for whimps! If you can’t look up the opcodes in the data sheet and type them in using a hex keypad, then you don’t need to be programming … period!
I’m kidding of course. The days of entering your program with a hex keypad are long gone. Now you can simply look up the opcodes, calculate the addresses, compute the CRC codes, etc. and type up a .hex file using notepad on one of those new fangled PCs.
Kids these days … they’ve got it so easy …
I’ve been a professional programmer working in mainframe and large PC software for a couple of decades. My interest in tiny microcontrollers is purely hobby. Regarding assembler vs. C, I remember the words of a brilliant programmer I worked with years ago: “When I give it a try, I can easily write tighter, faster assembler code than the optimizing compiler. However, unlike my own, the compiler’s optimizer is always switched on.”
Also, as someone who has a couple of decades of software experience behind me, I’ll point out that the time to write something at first is often not as big a concern as the time required to modify a program to meet changing requirements much later, after you’ve forgotten the details. C beats assembler for portability and maintainability.
mov DOPE_SLAP_CONTROL_REG, R16
That ought to get you about 333 kilo-dope-slaps per CPU mhz…
I started out writing C for AVR micros about a year ago. I since discovered the GCC collection includes an AVR C++ compiler and I have not looked back! I’m an engineering student and a “one man band” wanna be electrical engineer at a company, and after having been on the popular avr forums, I’ve got a couple gripes! #1, you nailed it. Who would even bother with any more than a little inline assembly? Even with a complete modbus implementation on an AVR mega series, there’s still plenty of room for program. If you run out, get a bigger chip. Which brings me to #2 — I call it “subsetting.” I question people who say “I do it the old, hard to do, hard to maintain, ugly way to do things because I’m more used to it.” You didn’t start out being more comfortable with it! You had to learn to do it that way! Why wouldn’t you learn the new way? Why stay static?
Anyway my 1 year in the industry usually disqualifies me from saying things like this, but really…Welcome to the new millennium. The chips are huge and high-level programming is easier to maintain and document. Like dave says, no excuses.
Thanks for the great videos!
I don’t understand the meaning of standards. The JTAG interface is standardized but the pinout is not. I have more than six different JTAG cables. Of course, each device has own software
I love your “get it up ya” style, don’t ever change
I agree the AVR fanboys are bad (#63), but the Arduino fanboys are worse than all the uC fanboys of all flavours combined.
As an employer I would probably laugh you out of the interview if you even mentioned the Arduino, if it was on your CV you wouldn’t get an interview.
Since when has “dumbing down” anything been good?
Is not “first principles” the best way to learn anything? Certainly it’s not the fastest way to make/do anythnig but they are not the same thing right?
EEVblog #45 – Arduino, PICAXE, and idiot assembler programmers @ EEVblog – The Electronics Engineering Video Blog is actually a pretty good website. I really like the design. I will bookmark it and come back to it again. I have one question though. Is your theme a premium one and where can I find it? Thanks!
Nice Dave show, I love to watch it !
Arduino is so weird to pronounce for english native speakers because it is an italian design!
I like particularly the waspmote architecture from Libelium (http://www.libelium.com/). this company seems to be at the origin of the Arduino design.
Anyway, what Dave calls sketches are c-like Language programming language. This comes form the famous processing, which made java language accessible to newbies.
As other open platforms. one can find more interesting to use Parallax propeller boards (http://www.parallax.com/tabid/407/Default.aspx) which make better sense than Arduino (according to me). One can find other extensions in the friendly gadgetganster website (http://gadgetgangster.com/find-a-project/56.html?projectnum=257).
Hey Dave, you can add the propeller topic to your shows, I will be very delighted to watch it !
Elec3i (http://elec3i.com) will try to develop some open kits around propeller in the next months…
I feel the same way about UNIX users that scoff at operating systems with a graphical UI.
“I can do X faster with my keyboard than you can with your drag-and-drop”
My response is usually something like:
“Yes, but it took you 10 years to get to this point”. Anyone can sit down and learn how to do X in 5 minutes in a Windows-based UI.
Is Arduino similar to the Beagle Board that NASA and JPL recommend?
The date was.. um… about July 1975 or maybe ’76.
I had just finished assembling the MITS Altair 8800 kit. It was setting on my coffee table begging to be programmed. The 2MHz crystal was missing so I put some capacitor from my meager parts box in it’s place. The 8080 ran at about 200KHz with this setup!
Hardware was VERY expensive. The Altair kit with the Intel 8080 and 256KB of memory with no I/O was $400.
I had sprung the extra bucks to upgrade the memory to 1024 Bytes (1 Kilobyte).
Programing was in _machine code_ thru front panel switches. No HEX keypads here.
The normal non-hobbyist programming method was to develop on some Big Iron tended by the IT priesthood. Punch a paper tape and read it in via a paper tape reader (what else would you use for paper tape). Hobbyists were out of luck.
Bill Gates was still at Harvard or had just started at MITS. The Altair BASIC was not yet written. Basic would cost more that the machine plus you would need something like a KSR-35 (IIRC) teletype with a paper tape reader to install it. The whole thing would have cost more that my first car. No open source here. I never forgave Bill. I use a Mac and as little M$ as possible.
I eventually bought a 16KB memory board (about $1000 IIRC) which would only run at 1MHz. I now had 17KB of static RAM. A Dazzler (2 S-100 boards and about a quarter lb of silicon) provided the output via a TV and a single transistor modulator. The display was selectable 64×64 pixels or 128×128 pixels. I forget the color choices but one mode had 4 colors and the other had 16.
I scratched together an interface for a mechanical keyboard* and 3 byte OCTAL display at some point and wrote a monitor program that would allow entry via the keyboard after the monitor was loaded.
I built the _Ignorance is Bliss_ magnetic tape interface** and had memorized the loader program in OCTAL. It was probably about 20 bytes or so. I could load it thru the front panel switches in about a minute and load 16KB of whatever was on the tape in about 2 minutes. (It worked flawlessly!)
I could go on… but the point is….
Something like the Arduino, even programmed in assembly, would have been, as Dave says, SEX on a stick…. fantastic… WOOHOO!!!!
But I wouldn’t have learnd as much.
*The keyboard had an arrangement whereby light beams were interrupted by a ‘comb’ attached to the key. The code was in what teeth were missing from the comb. Optotransistors or diodes provides an 8 bit code to my interface. Control codes were handled on 4 additional lines.
**2 caps and 2 diodes attached to the interupt line on the S-100 bus. Coding via pulse length measured by a deley loop.
Leave a reply