Author Topic: atmega programming problem  (Read 4402 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
atmega programming problem
« on: January 04, 2008, 04:27:38 PM »
So I am not sure if I broke my atmega or not . . .

Using AVR Studio I can change the ISP Freq in the Oscillator and ISP Clock settings without a problem or error, but everything else (program board, change fuses, etc) fails with an ISP Mode Error.

Did I perhaps mess up the clock settings? I'm using an external clock and it works fine on my other board, just this one chip isn't working . . .

Any ideas on saving it?

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
    • dunk's robot
Re: atmega programming problem
« Reply #1 on: January 04, 2008, 05:14:42 PM »
so you can change some fuse settings but not others?
sounds fried to me.
FIBA.
(F It. Build Another.)

i have noticed AVRs sometimes get a bit temperamental when you write to them loads in a short space of time.
i've never worked out if it's other external factors, my imagination or the chip heating up but try leaving it 20 mins and then come back to it.

dunk.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: atmega programming problem
« Reply #2 on: January 04, 2008, 05:22:01 PM »
I probably should explain more on what I did for it to end up in its state.

So I was working with one board, and all the fuse/clock/freq settings were set in AVR Studio.

Then I connected a new board, and just clicked the 'program' button (not even visiting the fuse settings or any other settings). Of course it gave an error during programming, then it had the above problems from there.

So I just wired up a 3rd board, and closed out the AVR Studio window to reset the settings, and after setting the proper fuses first, it programmed fine from there. I suspect its a bug in AVR Studio . . .

That board cost me $200 . . . so I'm a bit motivated to get it to work . . .

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: atmega programming problem
« Reply #3 on: February 05, 2008, 11:04:23 AM »
I was talking to afroman about this problem and he wrote:

Quote
I believe I have encountered the same problems. Unfortunately AVRStudio is a poorly designed piece of shit, and what seems to happen is that when you switch tabs, the fuses automatically get programmed before you even hit 'Program'. The result is that the chip doesn't seem to be able to be programmed again, right?
99% of the time, the situation is salvageable. The problem usually comes from the Divide Clock By 8 fuse being programmed. This results in the programmer pooping out data too fast for the chip to be able to accept. So what you have to do is go to the programming settings and change the default programming frequency of 125Khz to something at least 8 times slower, like 6khz. Apply the slower frequency setting, then go back to the fuses screen. You should be able to reprogram the fuses now. Once that has been taken care of, you can go back, and change the programming frequency to 125Khz again. Then you can program your data at full speed again. Hope that info is useful.

Wasn't quite the problem, as I hit the program button without ever switching tabs. The tabs were never closed out (I didn't push the connect button again after I reprogrammed a previous mcu and swapped it out) . . . I'm thinking that somehow some of the fuses/settings got carried over improperly.

Anyway, AVR Studio only offers me these options on the board tab:
603Hz, 4KHz, 28.8KHz, etc.

I tried each of those and still no luck.

Offline Maltaeron

  • Full Member
  • ***
  • Posts: 65
  • Helpful? 0
Re: atmega programming problem
« Reply #4 on: February 05, 2008, 07:28:43 PM »
Have you tried avrdude? I don't know if it would work with your board, but it might be worth trying...

 


Get Your Ad Here