Close
0%
0%

AVR on Arduino

An Extension to use Arduino boards with AtmelStudio, with usual coding that we all LOVE, 8bit registers and stuff + CHEAP AVR DEV BOARDS

Similar projects worth following
For those who work with both AVR and Arduino and sometimes just wish to use their AVR code on Arduino Boards cause the boards are cheap and work, the steps to upload are somewhat vague and confusing until you practice a lot and get the hang of it. requires avrdude and command line and remembering which Arduino board works with what commands.

Plus, while teaching AVR, students usually mess-up making the first boards, so an ARDUINO board can be a great Dev board for them with on-board programming and serial port access.

What I wanted was a single button upload from within Atmel Studio, I tried to look for a solution, when one wasn't available, started working on writing my own EXTENSION for the Atmel Studio 6.2, i still haven understood most of the code which I have copied from here and there, but the proof of the functionality is done, now I only need to put in the relevant commands of the different Arduino Boards for the upload to work and somehow figure out a few more thing

WANT: To upload AVR C/C++ code from Atmel Studio to my Arduino Boards

HOW: as easily and seamlessly as possible

OLD WAY

  1. Set the RIGHT Device in Atmel Studio
  2. Set the Clock Parameter, F_CPU=16000000
  3. Determine the COM Port of Arduino
  4. Have avrdude on system
  5. Put the proper avrdude command in the Post-Build of Atmel Studio Project
    1. The avrdude command uses different bauds and different programmer params for different Arduino board.

I tried this and some people liked it, https://github.com/zaidpirwani/AVR_on_Arduino

But overall, nobody used it much.

So, I finally installed all necessary stuff VS2010 and SDKs and what not and got working at it.

My goal, to give User a List of available COM PORTS and Arduino boards and when user selects those the project settings should change automatically and user should be able to upload his code in a single click manner.

This would allow me and others to use Arduino boards quite EASILY. Also, when teaching I can tell students to get any cheap Arduino board and start prototyping as usually they make their own boards and mess up, a lot. (I do plan to teach them to make their own boards - but later in the course)

SOURCE LINK / GIT REPO: https://github.com/Ejaad/AVRonArduino

  • 1 × Atmel Studio 6.2 without it, I dont think there would be much point or need of this plugin
  • 1 × Arduino Board (UNO / NANO / MEGA) either ATMega328p variants or the Mega with ATMega2560

  • New UI, simpler - Needs more Work

    ZaidPirwani08/30/2015 at 07:43 0 comments

    Changed the UI a bit, removed some elements and made it smaller.

    Adding avrdude command after post-build works but I doubt if it is the solution, cause everytime sending avrdude command after build means you have to wait for the upload to complete if the arduino is actually connected and the wait becomes a lot longer when the arduino is NOT there and that also means a failed build when actually the build did not fail but the upload did.

    So, am thinking.

    Putting up an UPLOAD button, and upload only happens when user clicks the button.

    so, now I need to figure that out, but if when user presses the button, it builds it first and if no error occurs then and only then it uploads it.

  • First Tests... Fixed Errors, found more.

    ZaidPirwani08/28/2015 at 11:44 0 comments

    Fixed error where if user did not scan for comports, the extension would later crash and take atmel studio down with it.

    There is also another error, which goes away if tool window is reloaded by why it comes, I dont know.

    Snapshots attached.!

    Tested the VSIX package on a few systems, works, but the extension folder inside the atmel studio folder is named randomly, so need to figure that out programmatically at runtime.

    Also, Post-Build will NOT work.

  • IT WORKS...!

    ZaidPirwani08/26/2015 at 13:58 0 comments

    After some pretty weird errors which would come and go as they please and then a permanent error which would disappear when the user RE-INITIALIZES the tool window in Atmel Studio, I was finally able to select a COM Port from the list (list of COM Ports generated automatically to show only the available Ports) and after selecting an Arduino Board form the Boards list (currently only Uno, Nano and Mega) - I could just click on Build and it would BUILD and UPLOAD to my Arduino board.

    Maybe it is not good to have it on Build always, but wont hurt much - I plan to add some more settings and features - tomorrow planning to try my hand at making a VSIX file out of all this so anyone can install the plugin.

View all 3 project logs

  • 1
    Step 1

    Download and Install and Usage instructions to be uploaded SOON.

View all instructions

Enjoy this project?

Share

Discussions

arief ibrahim adha wrote 01/01/2018 at 06:47 point

I like your project btw, but i rather use sublime for my text editor than avrstud, it seems have cozy black background for my eyes, and use my own board design. But when i have to use arduino board i use xloader to upload my code..

Keep update your project, maybe you can change my habit, at least your method its a simpler way to teach to some one else.  

  Are you sure? yes | no

Christophe Duparquet wrote 08/30/2015 at 08:48 point

I do not use Atmel Studio since I do not have Windows, but I think you may be interested by a project I'm working on : HWA (https://github.com/duparq/hwa).

It is a hardware abstractor that lets you forget hardware bits and registers, and use generic object-oriented instructions instead (but it is still standard C) without any penalty on the produced binary.

It is accompanied by ~20 examples that compile for 3 different kinds of boards and devices that I program using my 1- or 2-wire Diabolo bootloader (that is really fast, access time is ~0.5s, and has automatic wire and baudrate detection - I use between 115200 and 460800 bps). 

The build process, based on GNU Make, extracts all the required informations about the target (device, fuse bytes, etc...) from the sources. So, you just have to change the target name, and nothing else is required to have your project recompile and install quickly.

I wonder if it would work from Atmel Studio.

  Are you sure? yes | no

ZaidPirwani wrote 08/30/2015 at 09:27 point

I myself have been primarily on Linux Mint since 2 years now... but the majority of people here and those whom I teach - Windows is the OS of choice (only choice most of the times)

and now that Arduino boards are hell cheap and easily available  I thought it would be great for people wanting to learn AVR programming.

Buy Arduino
Download and install Atmel Studio
Download and install the Extension

Press UPLOAD to UPLOAD

  Are you sure? yes | no

ZaidPirwani wrote 08/30/2015 at 09:33 point

also, half of your project is going above my head, but looks interesting :)

  Are you sure? yes | no

DeepSOIC wrote 08/28/2015 at 13:07 point

Hmm, interesting.

I did it the other way around: design my own board, and make Arduino program it. A lot of work...

  Are you sure? yes | no

ZaidPirwani wrote 08/28/2015 at 13:19 point

well.. only China can make the cheapest boards...

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates