Arduino libraries when using ICSP

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

I am a new AVR user. I like to make specific projects based on the 328p whicch I program through the ICSP.

My simple question is, can I use the arduino libraries even though I am not p;rogramming an Arduino?

I will use the usual DDR statements to set pins for output  input etc.

Dave

 

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

Yes you can, as long as your programmer is supported by the Arduino IDE, if not you will have to wade through your documents to find the .hex file

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

David,

 

Your post is a bit confusing. Arduino implies several things:

 

1) and IDE and library to write software

2) a mechanism to get software from where you develop it into the AVR

3) a specific board layout and known set of peripherals

 

Just because you switch (2) from Arduino bootloader via USB to using a real ISP programmer doesn't have a lot of bearing on things. You can still use (1) and the target may still be (3).

 

If you want to switch (1) so you no longer use the Arduino IDE to write the software then, yes, you can still use things like the Serial class and so on. They are pieces of C++ software so the only requirement is that you build them with a C++ compiler but you can write other bits in C or even Asm if you like. When you look at libraries for Arduino there aren't usually too many inter-dependecies so you can probably "lift" a TFT-LCD (say) library and use it elsewhere but the one core feature it may well be relying on is digitalWrite() and pinMode() so you may need to take these too or implement equivalents. One common technique is to use the Arduino IDE one last time - set it to build for the AVR you plan to use and just build some simple sktech. In doing this, in the build directory it will generate a file called libcore.a. You can take a copy of that (assuming you can find it!) and then use that in future in the non-Arduino-IDE place (usually AS6). You added it to the list of libraries to link with (ie -lcore) and then when some "arduino code" you try to use makes calls to pinMode() and digitalWrite() and so on those things will be found inside libcore.a - there are many tutorials on the  internet about doing this. You can find them easily as they'll all mention "libcore.a" so just Google for that.

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

And  you can use other/better IDE plug-ins for Atmel Studio, like

http://www.visualmicro.com/