You are not logged in.

#1 2009-11-17 13:35:02

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Anyone with AVR experience?

Anything I should watch out for? I'm new to programming MCU's and I don't really want to screw it up.
I'm going to be using avra and avrdude most likely.


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#2 2009-11-17 16:44:35

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,827

Re: Anyone with AVR experience?

In general, they are solid and hard to kill.   But....

Watch your clock configuration bits.  If you are set up to use the internal RC, an external Crystal, or an external ceramic resonator, be VERY careful that you don't configure the clock as an external oscillator.  If you do, you stop clocking your device and cannot fix it since the clock is required by both JTAG and the programming ports.

If this does happen, I can (from experience) tell you the way to recover is to inject a signal into the clock in pin from an external generator to drive the chip while you fix the fuses via JTAG (or the programming pins [I Think]).  You can usually get away with this by just over driving the crystal with the generator, but to be extra safe, one can remove the crystal, fix the fuse, and but the crystal back.

Have fun.  The gcc avr cross compiler does a great job.

By-the-way, gdb can use simulavr as a simulator back end during code development, and can also use the JTAG as a back end for debugging on your target hardware.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2009-11-17 20:44:09

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: Anyone with AVR experience?

Thanks, I'll watch out for that.

Turns out avra doesn't even support the atmega644 (or at least they don't say they do)
So I figure while I'm learning I might as well learn C.

Know any good tutorials specific to avr?
(I'm gonna be using gcc-avr)

edit: Happy day! avr-as can compile assembly and has tutorials!

Last edited by z.s.tar.gz (2009-11-17 20:59:28)


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#4 2009-11-17 22:19:27

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: Anyone with AVR experience?

"Know any good tutorials specific to avr?" ->
http://djszapi.homelinux.net/Programmin … roller.pdf

And I used the datasheet of the special microcontroller.

Offline

#5 2009-11-17 22:22:37

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: Anyone with AVR experience?

A crappy tutorial I found on google actually tipped me off to the official atmel assembly guide, which is pretty helpful!


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#6 2009-11-18 02:11:50

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Anyone with AVR experience?

I grabbed one of these 'Nerdkits' - http://nerdkits.com/

Nice all inclusive kit, good set of instructions and introductory examples. The support/help is excellent too.

Offline

#7 2009-11-18 12:17:22

z.s.tar.gz
Member
From: Rural Florida
Registered: 2008-12-12
Posts: 298

Re: Anyone with AVR experience?

All went well with avr-gcc untill I actually tried to compile something. Then all it gives me is errors about libraries I didn't even include.

Probably my fault, but avra just seems so much simpler.


I need to find a way out so everyone can find their way out.
Resregietd Lunix Uesr: 485581

Offline

#8 2009-11-24 23:54:15

Grazz256
Member
Registered: 2009-06-28
Posts: 69

Re: Anyone with AVR experience?

What kind of error messages are you getting?
What complier options are you using?

Offline

#9 2009-11-25 23:40:26

tlvb
Member
From: Sweden
Registered: 2008-10-06
Posts: 297
Website

Re: Anyone with AVR experience?

Do you avr-libc and all the other specific build tools installed?
Do you have a minimal full program that generates the errors?

Also, a tip in general, it is quite nice to set up a generic-ish makefile that takes care of compiling and programming, on top of that, it is possible to to include asm snippets in the c code if you really want, however the libc does a number of initialisation stuff that I don't know how to get rid of (without not including io.h and loosing port defs etc).


I need a sorted list of all random numbers, so that I can retrieve a suitable one later with a binary search instead of having to iterate through the generation process every time.

Offline

Board footer

Powered by FluxBB