Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

How to change to AVR?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How to change to AVR?

by SuperMiguel on Tue Feb 09, 2010 5:48 pm

So im an EE student (still taking basic classes) and im learning about electronics, so i got my self an arduino and followed all the projects in ladyada website and i read the arduino started kit manual by earthshine design, and at the end i was able to build a robot : viewtopic.php?f=25&t=14402 but now i just want to go further in my learnings and everything seems to point to true avr... So what do you guys recommend to do this transition?? buy the stk500 or change the arduino bootloader to work with avr (http://www.arduino.cc/playground/Learning/Burn168) so what you guys recommend??? Thanks
SuperMiguel
 
Posts: 127
Joined: Mon Jan 04, 2010 4:09 pm

Re: How to change to AVR?

by mtbf0 on Tue Feb 09, 2010 8:43 pm

if you want to build projects in avr-gcc and upload them to an arduino board, the bootlader will do the job for you just fine. you can use avrdude to upload and, if i recall correctly, you set the programmer type to stk500, which the arduino bootloader apparently emulates.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: How to change to AVR?

by SuperMiguel on Tue Feb 09, 2010 9:00 pm

is it worth it getting the stk500??
SuperMiguel
 
Posts: 127
Joined: Mon Jan 04, 2010 4:09 pm

Re: How to change to AVR?

by len17 on Tue Feb 09, 2010 9:25 pm

SuperMiguel wrote:So what do you guys recommend to do this transition??


It depends what you want to do. If you want to get down & dirty with interrupts, timers, etc. then you'll have to program in "real" C. But if you mainly want to hack up some cool electronics controlled by straightforward software, it may be easier to stick with the Arduino development system.

Myself, I wouldn't use an STK500. It's overkill IMO and too big (and expensive) to put inside something else.

For messing around, you can use an Arduino or a cheap dev board or just a breadboard with an AVR chip. For a completed project, the BoArduino is a small & inexpensive alternative that includes a power supply.

Here's a project that uses a BoArduino, but I compiled the firmware with avr-gcc and programmed it with a USBtinyISP (wiping out the bootloader). So that's one way to go.

len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: How to change to AVR?

by SuperMiguel on Tue Feb 09, 2010 10:03 pm

Len17 wrote:
SuperMiguel wrote:So what do you guys recommend to do this transition??


If you want to get down & dirty with interrupts, timers, etc. then you'll have to program in "real" C.


well im an EE student so i guess i have no choice
SuperMiguel
 
Posts: 127
Joined: Mon Jan 04, 2010 4:09 pm

Re: How to change to AVR?

by westfw on Wed Feb 10, 2010 2:57 am

If you want to get down & dirty with interrupts, timers, etc. then you'll have to program in "real" C.

You know you can do that even within the Arduino environment, right? Arduino provides some simplified documentation and functions, but it does run "real" C underneath and you're free to completely ignore the simplified functions, and take over control from the few core bits that arduino tries to grab. For instance, see http://www.arduino.cc/cgi-bin/yabb2/YaB ... 1257722764

(this may not be the best way to impress your professors. But it's a fine way to actually get things DONE.)

(The big draw of an STK500 is its ability to program nearly any AVR chip. I have one, and I don't particularly like it (I never did get it to program my tiny11s. Too many jumpers and such.) I'd recommend some more complete "evaluation board" like a butterfly, raven, or MikroElektronika EasyAVR over a chip-programming focused board like the STK...)

westfw
 
Posts: 1722
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: How to change to AVR?

by mtbf0 on Wed Feb 10, 2010 8:45 am

here's a project that can be built using either avr-gcc or the arduino environment. it can be compiled using gcc for either a minipov3 board or an arduino board or it can be compiled within the arduino environment for an arduino board. stupid way to proceed, perhaps, but even though my target was the minipov3, starting out on a boarduino made it easy to prototype with a breadboard.

anyway, i think it shows that there's not that great a leap from arduino development to plain old avr development.

there are also some pretty cool arduino projects out there to support programming other avr chips. jeff keyzer's arduino high voltage programmer comes to mind.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: How to change to AVR?

by Entropy on Wed Feb 10, 2010 1:58 pm

If you want to not have to deal with the bootloader, the USBTinyISP is a great way to go.

My Boarduino is my primary AVR development environment, but I have never used the Arduino IDE - I often prototype things on it before "downporting" projects to smaller chips. I have a project running in an ATTiny85 that started in a Boarduino. The first thing I did was blow away the bootloader and just load things with the TinyISP.

Really, the Boarduino (and pretty much all other Arduino hardware) are Atmel ATMegaXX8 development boards. Some Arduinos now use even larger ATMegas. (never Tinys though.)

No real need for the STK500/600.
Entropy
 
Posts: 472
Joined: Tue Jan 08, 2008 12:43 am
Location: Owego, NY USA

Re: How to change to AVR?

by naxxtor on Wed Mar 10, 2010 12:06 am

If you're just looking to actually program some chips, and you're OK with breadboarding it first, just grab yourself a USBtinyISP (or another programmer if you want) and an atmega48/88/168 and you're away.

Here's two tutorials to get you started:
http://www.ladyada.net/learn/avr/
http://www.sparkfun.com/commerce/tutori ... ials_id=93

It should be noted (and has already been) that an Arduino is in fact just a ATMEGA168/328 development board that happens to have a funky bootloader that emulates a programmer. The bootloader lets you program it with avrdude with your own code that you've compiled with avr-gcc, entirely independant of the Arduino environment. The only thing is, if you want to do anything to the bootloader, you'll need a AVR ISP programmer (like ... the USBtinyISP).
naxxtor
 
Posts: 13
Joined: Tue Apr 08, 2008 7:42 am

Re: How to change to AVR?

by Smerky on Mon Mar 29, 2010 3:02 pm

naxxtor wrote:If you're just looking to actually program some chips, and you're OK with breadboarding it first, just grab yourself a USBtinyISP (or another programmer if you want) and an atmega48/88/168 and you're away.

Here's two tutorials to get you started:
http://www.ladyada.net/learn/avr/
http://www.sparkfun.com/commerce/tutori ... ials_id=93

It should be noted (and has already been) that an Arduino is in fact just a ATMEGA168/328 development board that happens to have a funky bootloader that emulates a programmer. The bootloader lets you program it with avrdude with your own code that you've compiled with avr-gcc, entirely independant of the Arduino environment. The only thing is, if you want to do anything to the bootloader, you'll need a AVR ISP programmer (like ... the USBtinyISP).


I recommend getting a USBtinyISP too. It works great. Just make sure you don't accidentally brick your MCU by flashing a fuse you don't want. But if you do happen to do that, like I have, I would recommend getting a RescueShield from MightyOhm: http://mightyohm.com/blog/products/avr-hv-rescue-shield/

It works great, works off my arduino, is cheap, and convenient.
Smerky
 
Posts: 6
Joined: Tue Dec 29, 2009 12:04 am

Please be positive and constructive with your questions and comments.