Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Locking an MCU due to wrong fuses, fow to fix?

Status
Not open for further replies.

neazoi

Advanced Member level 6
Joined
Jan 5, 2008
Messages
4,118
Helped
13
Reputation
26
Reaction score
15
Trophy points
1,318
Location
Greece
Activity points
36,907
Hi I tried to program a atmega644p-20pu and an atmega8 on a serial programmer using these fuses **broken link removed**
At this time I do not have the serial programmer anymore but a USBasp one, and I tried programming these two chips again. But in the new software when a fuse bit is checked, it means 1 and not 0. This is something I haven't taken care of, so essentially what I did by mistake, was to set all the other fuses, except the ones wanted.
So accidentally I set all the lock fuses.

Now I cannot erase the chips not even communicate with them (programmer complains cannot find target device).
I have tried them in circuit with a 20MHz crystal in place for the atmega644, applying external power or not. Neither worked.

Can you please let me know what to do?
 

A well known problem. Once you have disabled serial and JTAG programming, parallel programming is the only way to reset the fuses. See datasheet section 25.6 Parallel Programming.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
A well known problem. Once you have disabled serial and JTAG programming, parallel programming is the only way to reset the fuses. See datasheet section 25.6 Parallel Programming.

OMG! so I now need another programmer that supports parallel programming?
I guess I cannot do it with dip switches to set the appropriate bits to reset the chip as per 25.7.8 ?
 

Reviewing the documentation, I realized that disabling serial programming (SPIEN fuse) is not possible over serial programming, only over JTAG or parallel. Means you have not totally locked out further programming, but probably disabled the clock oscillator. In this case, it should work to connect an external clock source to pin XTAL1 to give programmer access.
 

Reviewing the documentation, I realized that disabling serial programming (SPIEN fuse) is not possible over serial programming, only over JTAG or parallel. Means you have not totally locked out further programming, but probably disabled the clock oscillator. In this case, it should work to connect an external clock source to pin XTAL1 to give programmer access.

All right, that's a relief.
I have a 20MHz crystal connected like this in the MCU, but it did not do anything. Maybe I should connect an external active crystal oscillator instead? What frequency?
 

Attachments

  • schematic_simple.gif
    schematic_simple.gif
    25.9 KB · Views: 103

Hi,

Yes, use no Xtal, but an oscillator.

Frequency: if I remember right, then it should with 1MHz and higher.
It will work with lower frequencies, but then you may need to slow down ISP clock frequency of the programmer, too.
Btw: this is what you can try anyway....

Klaus
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Just a valid external oscillator frequency up to 20 MHz. Probably not too low, there's a required relation to serial programming SCK.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
I'm no expert in Atmega devices but the schematic suggests it generates the negative voltage needed for serial communication comes from a charge pump (D8/D9) so check if there is a signal leaving pin 4. If it isn't there, try an external clock source. If it still isn't there, looks like you need a JTAG programmer.

Brian.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
I'm no expert in Atmega devices but the schematic suggests it generates the negative voltage needed for serial communication comes from a charge pump (D8/D9) so check if there is a signal leaving pin 4. If it isn't there, try an external clock source. If it still isn't there, looks like you need a JTAG programmer.

Brian.

No this is not for the ICSP this is just a serial port fit for the project (it works).
All the answers here are very helpful, I will try the external osc option as suggested and let you know.
Thanks all!
 

Hi,

Yes, use no Xtal, but an oscillator.

Frequency: if I remember right, then it should with 1MHz and higher.
It will work with lower frequencies, but then you may need to slow down ISP clock frequency of the programmer, too.
Btw: this is what you can try anyway....

Klaus

Thanks it worked for the atmega644 I unlocked it and programmed 3 of these correctly!

But how about the ATMEGA8 ?
I connect the oscillator on pin 9 or 10 of the DIP and it does not seem to work
 

I had similar problem programming ATmega16/32 on EasyAVR v7 and I guess I just removed the XTAL or plugged a low-frequency XTAL and programmed.
 

I had similar problem programming ATmega16/32 on EasyAVR v7 and I guess I just removed the XTAL or plugged a low-frequency XTAL and programmed.

This did not work in my case with the atmega8. It only worked with the atmega644. I have tried initially a 12MHz clock and then a 3.5MHz. I have tried applying it in both clock pins just in case. Neither worked. What am I doing wrong?
 

Hi,

Reset, brown out?
Wiring?
Supply?

I don't think it needs anything else..

Klaus
 

Hi,

Reset, brown out?
Wiring?
Supply?

I don't think it needs anything else..

Klaus

Ok It may be a little confusing, so here are the connections I did on the DIP atmega8:
Pin 1 RST also connected to programmer
Pin 19 SCK also connected to programmer
Pin 18 MISO also connected to programmer
Pin 17 MOSI also connected to programmer
Pin 7 and pin 20 VCC 5V connected to programmer VCC
Pin 8 and pin 22 GND also connected to programmer GND
I have tried external crystal oscillator modules connected on pin9 at first and pin10 next, to try out.

Is there anything else I forgot to connect?
 

If it is locked when you used say 20 MHz crystal then put a 4 Mhz crystal on board and then in compiler settings change XTAL frequency to say 4 MHz and build it and try to burn. See if this works. I had done something like that when I had same issue of locking with mikroC PRO AVR Compiler, ATmega16/32/2560 and 16 MHz crystal and mikroProg for AVR programmer.
 

If it is locked when you used say 20 MHz crystal then put a 4 Mhz crystal on board and then in compiler settings change XTAL frequency to say 4 MHz and build it and try to burn. See if this works. I had done something like that when I had same issue of locking with mikroC PRO AVR Compiler, ATmega16/32/2560 and 16 MHz crystal and mikroProg for AVR programmer.

When it was locked it used the internal RC oscillator. I guess it was set to 8MHz I am not sure.
So what value of crystal oscillator should I try and is the exact value critical?
 

When it was locked it used the internal RC oscillator. I guess it was set to 8MHz I am not sure.
So what value of crystal oscillator should I try and is the exact value critical?

Try with or without 4 Mhz crystal on programmer board and try to compile code for 1 MHz and burn. See if this works.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top