I want to learn AVR C programming instead of arduino programming. I have an arduino UNO board and few Atmega328 chips that I bought, and Atmel studio for programming. Can I UNO board as programmer to flash the chips from Atmel Studio? Or any other alternatives?
|
If your chips have a bootloader already installed in them, you can use any USB -> Serial cable (FTDI cable) to program them in-circuit on their Rx/Tx pins. If not, you can use the Uno to program a boot loader into them (one time) and program them with the cable from then on. To use standard C, you can use the bare chips or the UNO. You'll want a different environment than the Arduino IDE, though. That can be anything from an editor, the the gnu compiler tools run from a command line, to almost any other IDE. A number of people, myself included, use the Eclipse IDE with an AVR plug-in and do almost everything from writing the code to programming the AVR from within it. (I say 'almost' only because I personally prefer a full-blown programming editor, run outside of the IDE, for initial creation of sizeable projects or major edits and rewrites. That isn't necessary, though). |
|||
|
If you're starting out then Atmel Studio is a good option - it's very easy to install and get up and running, and I use it. To use an Arduino as an ISP you're going to need to use AVRDude. You can configure Atmel Studio to flash chips using AVRDude - I struggled with this but eventually got it working, you can look here if it will help - not specifically for the Arduino as ISP, but should get you started. Finally you should also double-check whether you have ATmega328-PU or ATmega328P-PU - AVRDude doesn't support the ATmega328-PU (without the P) so you'll need to do a workaround (again something that I've been caught out with in the past, [here's how I worked around it] (http://www.crash-bang.com/resource/bootload-atmega328/) Good luck - programming the AVR directly is more challenging but gives you more control. |
|||||
|