Help, Unable to program after fusing atmega32 bits

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

Hello, I am working on my college project where I need UART communication using ATMEGA32 uC. I decide to use 11.0592MHz external crystal. For that I set FUSE bit as CKSEL: 1111, CKOPT:0 and SUT:11. But now after setting these fuse bit programmer is unable to communicate with the uC even if I connect 11.0592 crystal oscillator at XTAL1 and XTAL2.

 

Please help me.

 

Thanks in advance

This topic has a solution.

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

Did you remember the caps?:

 

 

By the way, in order to program an AVR over ISP a valid system clock must be present.  If you have fused for external crystal, you must have one (properly) installed in order to program the AVR again over ISP.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Hello Joeymorin,

 

Yes, I am using the same connection. And Capacitor used are 22pf.

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

Perhaps the oscillator isn't singing.

 

Try injecting an external clock into XTAL1.  This can be any TTL-level clock source... another AVR wiggling an I/O pin... a 555 timer... an external oscillator module... and Arduino...

 

What programmer are you using?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

I am using usbasp programmer.

 

I try to generate clock from another microcontroller using the following code:

#include<avr/io.h>
#include<util/delay.h>

int main(void)
{
    DDRB |= 1 << PINB0;
    
    while(1)
    {
    PORTB ^= 1 << PINB0;
    }

}

 

And luckily this work. But still I am not able to figure why it does not work with crystal oscillator. I also try other crystal oscillator but still same result. To test if crystal if working fine or not, I burn a blinking led program and I see some weird behaviour. Led blink only when I touch the crystal. 

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

That suggests that your crystal either faulty, or your setup is dodgy.  Can you show a photograph?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Don't know what is the reason but everything works fine when I replace the microcontroller. May be the previous microcontroller is faulty.

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

I am fairly new to AVR, but I can bricked a couple of AVRs by setting incorrect fuses. Sounds like you bricked your AVR by setting an incorrect fuse (disabling the RSTDISBL or SPIEN). If you have a High Voltage programmer like the STK500 or AVR Dragon, you can see if you can program via High Voltage Programming, then enable those fuses.

 

 

 

"When all else fails, read the directions"

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PhillyNJ wrote:
Sounds like you bricked your AVR by setting an incorrect fuse
Unlikely.  As the OP has stated, the programmer cannot communicate with the AVR unless he/she touches the crystal.
Quote:
(disabling the RSTDISB
Then touching the fuse wouldn't help.
Quote:
L or SPIEN).
Impossible to do over SPI

 

I suspect a poor connection with the crystal or caps.  If this is on a breadboard, know that the tracks and wires have significant capacitance.  You could try reduing the capacitors to 18 pF and try with the same microcontroller again.
 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Swapping out the micro with a new micro, and having it work, suggests that the new micro is running on its internal RC oscillator, while the "bad" micro still has it fuses set to the incorrect clock source type.

 

JC

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

Hello PhillyNJ,

 

Thanks for the suggestion, But now I am able to  program the micro-controller by giving external clock(generated from other micro-controller).

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

Thats not the case.... I have also set the fuse bits of the second micro-controller.

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

yup.. that may be the case. I will try with 18pf capacitor and let you know if that work or not.

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

Hello joeymorin,

 

You are right, problem is the poor connection of my old breadboard. I have replace that by new breadboard, Now both the micro-controller are working fine.

 

But now I am facing another problem, can you please help me to solve that problem also.  I have created new thread for that issue, please check the line: http://www.avrfreaks.net/forum/g...

 

Thanks