How do you program an avr

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

I have been reading the data sheets of the various 8 bit avr devices that I use trying to understand just how they are programmed.

All can be programmed by SPI Programming Interface.

I can not see what part of the data sheet describes this.

I can not find the right application note on Atmels Web site.

Would someone be as kind as to point me in the right direction.

What I want to know are the signals and timming applied to each pin during programming.

John

If all else fails, read the instructions.

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

I just looked at a ATmega88 datasheet. It's
explained in the section "Memory Programming".

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

Quote:

All can be programmed by SPI Programming Interface.

Typically true. It might be safer to phrase it something like "the serial ISP for AVRs uses an SPI-like mechanism". Note that on certain models the pins used are NOT the SPI pins.

The short answer to your question is to pick a mainstream model, e.g. Mega88. Look in the datasheet for the Memory Programming chapter. Within that, look at the Serial Downloading section.

There are indeed some app notes on this. From the host side see AVR910. Also search the forums for "buttload" (I forget the new P.C. name).

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

But, the spec sheet tells you nothing about how to do it in real life. Yes, it tells you which pins to use.

The key is that you need some kind of "programmer". Examples include, but are not limited to, Atmel "Dragon" and Atmel "AVRJtagIceMkII".

You use the programmer with AVR Studio (with or without WinAVR) or with the command-line tool AvrDude or through the programming interface of one of the proprietary IDEs.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Many thanks everyone.

I can see it now in 27.8 on the ATmega88 data sheet.
Dont know why I did not see it before.

John

If all else fails, read the instructions.

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

At Amtel's website, AVR application notes: there are several documents dealing with programming. One you might be interested in is AVR-910. This describes an in system programmer with RS-232 interface. The source code can be downloaded. It is propriarity yes, but is is also open!

Although the spec (in datasheet) was sufficient to design my own ISP programmer. Be warned that not al AVR's use the same protocol, and you need a running CPU clock which is at least 4 times higher then the serial clock. Not al AVR support ISP.

It is worth to attent a Atmel seminar and get a STK-500 for free ;-) If ISP fails (because you changed some clocking fuses), then you need parallel programming in order to bring the device back...