But how do we explain the poor performance of Wiring-GCC compared to GCB? Is the Arduino-GCC compiler that inefficient when changing the state of an I/O pin?
I see similar results with ChipKit Uno32 compared to GCB on an 8 bit PIC. The 8 bit PIC is much faster at toggling an I/O pin.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"Is the Arduino-GCC compiler that inefficient when changing the state of an I/O pin?"
OMG Yes!
If you dig deeper into the Arduino IDE you find that underneath it all is a convoluted maze of crap called "the Library" all written to make the top level easier for beginner's. I've never totally understood the popularity since GCB and other real compilers have simplified programming long before Arduino.
chipKIT and DUE are 32 bit so they take up more memory as well. When I wrote my book "Getting Started with chipKIT" I ran a blink LED comparison like you did and it took up like 2K of space to blink an LED.
The only difference I could see between the Arduino and what existed before is that most professionals laugh when you say you program in BASIC. But tell them you program in assembly and they are a bit amazed. Since GCB produces pure assembly, what is the difference....the name BASIC.
C seems to be universally accepted by industry as the only real embedded compiler language and Assembly is for the rare nerds who want to deal with that pain so when the Arduino team (a bunch of students in Massimo's class) took the BASIC Stamp concept of simplified commands (which was the basis for the Arduino team) and applied it to C language, it was instantly accepted and the open source nature expanded its appeal.
Hobbyists and professionals were now on the same platform. It took off. But what a load of crap underneath. But then you look at what it has produced. 3D printers mostly run on Arduino. Shapeoko CNC and others run on Arduino. Numerous Internet of things now run on Arduino. The applications are endless and most users just plug and play so they don't need to really know much about the code.
Did you know that Arduino creates a .hex file and then erases it after programming the device? You have to enable a setting to keep the files around. They don't want to even show that to the user.
It was why myself and a few friends created the PIC based CHIPINO. It was a means to show you could program with any compiler in any language and use most of the shields and get a lot better results with true compiled/assembled code. Some like it but most don't get it. We showed it at MakerFaire and all we got was kids laughing at it because it couldn't run Arduino code.
The only interesting thing I've experienced is when recent college graduates who were trained on Arduino interviewed for a job, many reported that the recruiter laughed off the "Experience with Arduino" and asked what actual embedded programming did they know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Arduino ide uses avrdude too.
Last edit: Frank Steinberg 2015-01-13
Yes, I know.
But how do we explain the poor performance of Wiring-GCC compared to GCB? Is the Arduino-GCC compiler that inefficient when changing the state of an I/O pin?
I see similar results with ChipKit Uno32 compared to GCB on an 8 bit PIC. The 8 bit PIC is much faster at toggling an I/O pin.
"Is the Arduino-GCC compiler that inefficient when changing the state of an I/O pin?"
OMG Yes!
If you dig deeper into the Arduino IDE you find that underneath it all is a convoluted maze of crap called "the Library" all written to make the top level easier for beginner's. I've never totally understood the popularity since GCB and other real compilers have simplified programming long before Arduino.
chipKIT and DUE are 32 bit so they take up more memory as well. When I wrote my book "Getting Started with chipKIT" I ran a blink LED comparison like you did and it took up like 2K of space to blink an LED.
The only difference I could see between the Arduino and what existed before is that most professionals laugh when you say you program in BASIC. But tell them you program in assembly and they are a bit amazed. Since GCB produces pure assembly, what is the difference....the name BASIC.
C seems to be universally accepted by industry as the only real embedded compiler language and Assembly is for the rare nerds who want to deal with that pain so when the Arduino team (a bunch of students in Massimo's class) took the BASIC Stamp concept of simplified commands (which was the basis for the Arduino team) and applied it to C language, it was instantly accepted and the open source nature expanded its appeal.
Hobbyists and professionals were now on the same platform. It took off. But what a load of crap underneath. But then you look at what it has produced. 3D printers mostly run on Arduino. Shapeoko CNC and others run on Arduino. Numerous Internet of things now run on Arduino. The applications are endless and most users just plug and play so they don't need to really know much about the code.
Did you know that Arduino creates a .hex file and then erases it after programming the device? You have to enable a setting to keep the files around. They don't want to even show that to the user.
It was why myself and a few friends created the PIC based CHIPINO. It was a means to show you could program with any compiler in any language and use most of the shields and get a lot better results with true compiled/assembled code. Some like it but most don't get it. We showed it at MakerFaire and all we got was kids laughing at it because it couldn't run Arduino code.
The only interesting thing I've experienced is when recent college graduates who were trained on Arduino interviewed for a job, many reported that the recruiter laughed off the "Experience with Arduino" and asked what actual embedded programming did they know.
Good info and explains why you can't get a delay shorter than about 5 us using Arduino-GCC.
With GCB all that is needed is to add a few "NOPs".
Last edit: William Roth 2015-01-13