Arduino IDE V Atmel studio

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know both of these will program an AVR. Is there a benefit, code size or running speed, of one over the other. Speed isn't a real issue but code size is. Does the Arduino automatically add Arduino libaries that may not be needed? Does the compiler weed out unwanted/needed libarary comands or are they all compiled in the code?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

They both use avr-gcc as the compiler. Arduino includes some extra code to support millis() and some other things. For the most part only what is needed is included. Look at the Arduino core code to see what it is doing.

If you are really concerned about code size, then Atmel Studio is probably the choice - Depending on what you are actually doing it might be a toss up. Note that Arduino is really just adding a layer of framework - it automates boring things like library management.

 

Arduino is going to win on convenience - you want a serial port - Serial.begin(), i2C etc no fiddling with finding and including libraries to do that as you would in Atmel Studio. If you don't like how Arduino abstracts the port i/o - digitalWrite() etc, then you can just access the ports as you would in Atmel Studio- PORTB |= (1<< 6) and so on.

 

If you want a better development environment than Arduino (the editor is really cheap n cheerful), then there's the likes of PlatformIO that give you a much more full featured IDE with the convenience of the Arduino framework. You also get the option of a wider variety of microcontrollers. Where Atmel Studio wins hands down is debugging.

 

If you're pushed for code size, then maybe look to use a different microcontroller.  Unless you're making zillions of a device, is 50 cents between different devices a deal breaker? How much time and effort will you spend squeezing your code into a smaller device? If you want a physically smaller chip - then go for a surface mount package. TQFP is easy to hand solder, QFN a little tricker - you would want a hot air tool. BGA is out (for me at least) for hand soldering.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Kartman, once again you have provided the answer I expected. At the moment I am ok with code size and should be able to squeeze it on a ATTiny3217. If this all goes to plan I hope to producing 000's so a few extra cents won't make a difference. At the moment I have the code working quite well on a Arduino mega 2560. The code compiles to about 21K at the moment but I need to add some scrolling for a bitmap or 2. Then maybe then a colour display. Currently it is on an SSD1306 OLED. The scrolling seems to be a bit of a problem, it would be easy if I could use text. I am displaying a single number as a bitmap but when I try to do text large enough to fill the screen it "wraps" off the bottom of the screen. The bitmap it perfect but text would same heaps of code space.