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 use Arduino 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. |
|||||
|
It's not really clear what you think the difference is. You can use the Arduino IDE to do "straight AVR" programming, for example:
The AVR register names (eg. DDRB, PINB, PORTB and so on) will be included by the IDE, however you don't have to use a single Arduino library or function if you don't want to. |
|||||||||
|
You can use the Atmel Studio + Visual Micro plugin to easily get started with atmega328 + support for the uno board (easily program, use arduino libraries etc). Checkout here. http://www.visualmicro.com/page/Arduino-for-Atmel-Studio.aspx |
|||||
|