AVR Programming Problem

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

I'm a noob at this and I can't get my AVR dragon to program the atmega8 I have. The crystal I have doesn't oscillate, but the avr studio still returns "entering programming mode failed" when I use an external oscillator. I'm guessing I have some fuses set wrong? Any help would be appreciated.

-Mason

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

"external oscillator" or "external crystal"?

If you have a crystal, you select external crystal.
If you have a oscillator, you select external oscillator.

Oscillator is a thing that spits out clock by itself. A crystal does not.

So you need to give the AVR what it wants - a clock of any kind. 3V logic level square wave from any source, between 1 to 8 MHz, from a signal generator, RC oscillator or crystal module or something.

- Jani

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

I was using the ttl output of a function generator set at 1mhz. How do I set it to external crystal or external oscillator? Avrstudio gives an error when I try to change the fuse settings.

-Mason

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

Oscillator

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

From Datasheet: To drive the device from an external clock source, XTAL1 should be driven as shown in Figure 13.
This means Clock input to XTAL1 pin, don't forget the ground connection.
Clock voltage swing may not be higher than Vcc.

  _   _   _  
_| |_| |_| |_     Ground to 3 Volt ( Max Vcc )

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

I'm doing that. It still gives and error when I try to change fuse setting or do anything in avr studio.

When I start it up at first, it can read the isp frequency fine, but after a while, it produces an error on that too.

-Mason

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

Do you have something connected to the ISP pins, except the programmer ?
What is your programmer ? usb, serial, lpt ?
Is your programmer Avr Studio compatible ?

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

I have only the reset pullup resistor and the isp connections.

The programmer is the avr dragon, which is usb and hopefully avr studio compatible.

-Mason

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

Do you supply voltage to the Dragon ?

-> AVR Dragon must sense the target voltage at pin 2 on the ISP header in order to set up the level-converter.

- Is the dragon supported in your version of Avr Studio
check Help. Version 4.13 Build 528 does.

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

The vdd pin and pin 2 are tied together on the dragon. The dragon does not require a separate power supply apart from the usb does it?

I will check to make sure about the build and the version of my avr studio, but I'm pretty sure thats not the problem as the connection button shows the usb dragon as an option. clicking on that gets me to a configuration window with options for the fuses and board etc. However, most things on the configuration window return errors when I try to do them.

-Mason

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

I have no other ideas , Sorry

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

Try setting the ISP frequency of the Dragon to 125Khz and see if you can read the signature of the chip ( correctly chosen from the list).

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

I can set the frequency. How do I read the signature of the chip?

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

First make sure that the correct chip is selected in the Program tab.

Then goto the Advanced tab you will see the read signature.

You should be able to read the signature with no erors before trying to do anything else. Make it a habit.

Pete

Edited the Advanced tab

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

It produced an error and says the signature is 0x00 0x00 0x00.

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

Go to the Board tab. There you will see the voltage of your board read by the dragon. Further down is the ISP frequency setting. What is the ISP frequency?

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

100 hz. Trying to change it to something else produces an error saying setting sd=0x06 failed.

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

You need to have your board hooked up and powered for the dragon to be able to change the ISP frequency.

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

to the best of my knowledge it is. The isp pins go to the correct pins on the dragon. The chip is powered from vcc from the dragon.

All thats hooked up on the chip is the reset pullup resistor, isp wires, and oscillator input to pin 9.

It does say setting device parameters ok.

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

I was just messing with my dragon and set it to 100hz and in trying to get back to 125khz I kept getting ISP errors. What I did was, closed the dragon and then reopened it ,and was able to reset my ISP speed to 125khz.

If you can't read the signature then all the settings are pretty much meaningless.

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

I ended up wiring the dragon for parallel programming, and it works now. Thanks for all the help.