Fuse bit and flash ?

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

Guys,

 

I can't read my fuse bit on ATMEGA128 ? Is the chip broken already ?

I try to write, it can be written but the content is not valid and the content of fuse bit are all 0, I try to write fuse bit, the programmer said, it was written but when I read it back,

it's not changing...still 0....

 

Any solution for it ?

 

Thanks

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

Start by trying to read the signature back from the chip. If you can't do that then nothing else is working. It's probably a wiring issue.

 

Are you trying to use JTAG or ISP?

What interface are you using?

What software on the PC are you driving it with?

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

 

Start by trying to read the signature back from the chip. If you can't do that then nothing else is working. It's probably a wiring issue.

Do you mean "ID" of the chip ?

 

Are you trying to use JTAG or ISP?

I'm using ISP

 

What interface are you using?

I don't understand what you mean ?

 

What software on the PC are you driving it with?

I'm using an ISP programmer.. PROGISP v1.72

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

I meant the three signature bytes. The datasheet tells me you should be able to read 0x1E, 0x97, 0x02. If you can't read those your programmer/wiring is broken.

What interface are you using?

I don't understand what you mean ?

Well I can only guess but it could be any of AVRISPmkII, Dragon, STK500, JTAGICEmkII, JTAGICE3, Atmel-ICE, USBAsp, USbtinyISP, or one of many others. It's the thing that connects to your PC (probably USB) at one end and to the ISP pins of the AVR at the other.

I'm using an ISP programmer.. PROGISP v1.72

Oh so it probably is a USBAsp or something like that is it? Have you tried using avrdude to drive it instead? With avrdude you can get loads more feedback when there is a problem.

 

BTW I hadn't spotted your ID previously - so this presumably is not a new AVR or programmer but something that have been working for a while? Are you saying it suddenly stopped working? In that case it could be a broken wire or it could be that your changed a fuse that makes it difficult to read the AVR. Or is this a brand new chip you are trying to contact for the first time?

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

Why not use avrdude?   It is reliable software.

 

Progisp1.72 is written in Chinese.   It has no English manual.    There are several "features".

 

If you describe your actual hardware.   e.g. link to your actual USBASP dongle.

And your actual wiring.

 

I can probably reproduce your setup on a real 128 and with a specific USBASP.   Even the horrible USBISP

 

David.

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

My interface is USBASP, is that what you mean ?

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

BTW I hadn't spotted your ID previously - so this presumably is not a new AVR or programmer but something that have been working for a while?

Yes it was working awhile

 

 

Are you saying it suddenly stopped working?

Yes It stopped working suddenly

 

In that case it could be a broken wire or it could be that your changed a fuse that makes it difficult to read the AVR.

I tried to change the fuse by external clock connected to X1, but still not working....shall I disconnect the crystal first ...or just connect external clock directly to X1 ?

 

Or is this a brand new chip you are trying to contact for the first time?

No, it's an old working chip...

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

Well,  I tried the mega128 with a regular USBASP and the horrible USBISP via progisp1.72

 

And it read my fuses, lockbits, calibration correctly with both types of dongle.

 

(I verified the values using avrdude and the real USBASP )

 

So I suspect that you have not connected your ribbon cable correctly.

 

While I was at it,   I read fuses, lock and calibration via a $10 JTAGICE-1 clone.   Both with AS4 and avrdude.

 

David.

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

Yup just sounds like a dodgy connection. 

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

I tested with different chip, same PCB and connection and same programmer, it worked, seems my chip is broken already....

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

Are you SURE this isn't just a fuse accident? If it's a 128 about the only fuse accidents you can have are:

 

1) switching off SPIEN but to do this you would have needed to use a JTAG - if your only software/interface is ProgISP and USBAsp then you cannot have done this.

 

2) switching the CKSEL fuses to select "external clock" instead of "external crystal". If you have done this you should be able to recover by injecting a clock into XTAL1 as you try ISP.

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

I tried to change the fuse. but it's always 0000 on CSEL.....I can't update it....I reckon my chip is saying good bye to me.....

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

I would agree with Cliff.    You can't really do much damage to a mega128.     Just add an external clock to XTAL1.

 

However,    I would be a lot happier if you revealed which "USB?SP" dongle you are using.    If you used avrdude,   we would know that you are using reliable software that actually gives you error / status reports.

 

David.

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

I've tried with external clock from another atmega128 generated clock

 while (1)
    {
	    PORTD = ~PORTD;
		_delay_us(1);
	 }

but it didn't give me any response on changing the fuse bits....

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

This is the fuse bit :

 

I used external clock 1Mhz already, but I can not change fuse bit, no mater what, any ideas ?

thanks

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

david.prentice wrote:

However,    I would be a lot happier if you revealed which "USB?SP" dongle you are using.    If you used avrdude,   we would know that you are using reliable software that actually gives you error / status reports.

 

When a user reports a problem,   I can (and quite often do) try many combinations of USBASP,   programming software,  AVR targets,   ...

i.e.   I can reproduce their hardware etc. to see if I can view their problem.

 

In which case,   it is pretty easy to see what a problem might be.

If you are reluctant to say which particular USB?SP model you are using,   all that we can do is speculate.

 

It appears to be reading all the fuses as 0x00.    This means that something is wrong.

You are clearly using Chinese software.    Do you understand Chinese?

 

David.

Last Edited: Thu. Apr 16, 2015 - 10:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's USBASP V2.0 written on PCB

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

@bianchi77,

 

Surely you bought it from Ebay or Aliexpress.    In which case you can post a link to the photo.

 

I bet that it has more 'writing' on the pcb than just "USBASP V2.0"

My patience is wearing thin.    Answering my question would take you about 2 minutes.

 

When we have to go on for days to extract every drop of blood,   it is a little disheartening.

Especially when most of these things can be wrapped up within 10 minutes or so.

 

David.

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

I bought it from ebay 4 years ago from ebay

here are the photos

 

 

Last Edited: Thu. Apr 16, 2015 - 12:16 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Of course,  it would have been asking too much to just say:

 

USBASP V2.0

Lcsoft Studio

 

Or even to post the photo the right way up.

However,   it would have been better to have posted an Ebay link.

 

Yes,   I have one of those.    And it reads a mega128 just fine.    With Progisp1.72 or with avrdude.

 

If you have killed the clock fuses,  an external 1MHz clock on XTAL1  should revive it.

avrdude -c usbasp -p ATmega128 -v

 

David.

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

where can I download executeable of avrdude ? I've downloaded c code of it ??? abit confuse now..
 

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

C:\WinAVR-20100110\bin>avrdude -c usbasp -p ATmega128 -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : lpt1
         Using Programmer              : usbasp
         AVR Part                      : ATMEGA128
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    12    64    0 no       4096    8      0  9000  90
00 0xff 0xff
           flash         33     6   128    0 yes    131072  256    512  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e9702
avrdude: safemode: lfuse reads as 3F
avrdude: safemode: hfuse reads as C1
avrdude: safemode: efuse reads as FF

avrdude: safemode: lfuse reads as 3F
avrdude: safemode: hfuse reads as C1
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK

avrdude done.  Thank you.


C:\WinAVR-20100110\bin>

from AVR dude....what does it mean ??

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

What it means is that you can visit http://www.engbedded.com/fusecalc/ and see for yourself.

 

Your fuses are perfectly reasonable.    If you had to inject an external 1MHz clock,    you can assume that your HF crystal is dead.

 

The BOD is set for 4.0V.    So if you had set the USBASP for 3.3V,   the AVR would Brown-Out.

 

David.

 

p.s. you have 919 posts.    I know that when you started,   you were a little 'hyper-active'.    Now that you have mellowed,   you will get more replies.     But I suggest that you put some effort into reading any answers.    Otherwise you will find that people don't bother.

 

Since avrdude is working ok,   your Progisp1.72 'should' work.     Can you understand Chinese?

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

david.prentice wrote:

What it means is that you can visit http://www.engbedded.com/fusecalc/ and see for yourself.

 

Your fuses are perfectly reasonable.    If you had to inject an external 1MHz clock,    you can assume that your HF crystal is dead.

 

The BOD is set for 4.0V.    So if you had set the USBASP for 3.3V,   the AVR would Brown-Out.

 

David.

 

p.s. you have 919 posts.    I know that when you started,   you were a little 'hyper-active'.    Now that you have mellowed,   you will get more replies.     But I suggest that you put some effort into reading any answers.    Otherwise you will find that people don't bother.

 

Since avrdude is working ok,   your Progisp1.72 'should' work.     Can you understand Chinese?

Hi David, I used a test board for it, no Crystal at all, only the chip and power supply...how do you know BOD = 4V.....I use USBASP with 5V supply......

Thanks for the info about fuse....

I'm thinking, my atmega128 is ready for goi'n to rubbish bin....

Yes I can speak chinese a bit but can not read the characters....

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




C:\WinAVR-20100110\bin>avrdude -c usbasp -p m128 -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : lpt1
         Using Programmer              : usbasp
         AVR Part                      : ATMEGA128
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    12    64    0 no       4096    8      0  9000  90
00 0xff 0xff
           flash         33     6   128    0 yes    131072  256    512  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.08s

avrdude: Device signature = 0x1e9702
avrdude: safemode: lfuse reads as 3F
avrdude: safemode: hfuse reads as C1
avrdude: safemode: efuse reads as FF

avrdude: safemode: lfuse reads as 3F
avrdude: safemode: hfuse reads as C1
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK

avrdude done.  Thank you.


C:\WinAVR-20100110\bin>

That's the result from avrdude....

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

I can not change to external clock.....suppose to be 31 for lfuse but still 3F no matter I tried to override it...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
C:\WinAVR-20100110\bin>avrdude -c usbasp -p m128 -v

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"


         Using Port                    : lpt1
         Using Programmer              : usbasp
         AVR Part                      : ATMEGA128
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom         4    12    64    0 no       4096    8      0  9000  90
00 0xff 0xff
           flash         33     6   128    0 yes    131072  256    512  4500  45
00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           calibration    0     0     0    0 no          4    0      0     0
 0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
 0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: warning: cannot set sck period. please check for usbasp firmware update
.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000102
avrdude: Expected signature for ATMEGA128 is 1E 97 02
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.


C:\WinAVR-20100110\bin>

I tried to change it and the result is above......the chip is death...

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

I used the http://www.engbedded.com/fusecalc/  to read what 3F, C1, FF mean.    You type the hex values into the boxes,   and it displays the fuse meanings in English.

 

No,   I can not work out fuses manually.    It does my head in.

This is why we use fuse calculator websites.

 

You will also see that the fuses are set for a crystal.    If you have no crystal,   you have no clock.

So I assume that you had to inject 1MHz into XTAL1.

 

After 921 posts,   you should have understood the clock fuses.

Also,   you would understand that pasting the same output from avrdude twice will only serve to irritate.

 

David.

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

Yea right, with crystal, I tried just now, and can't change the fuse as well....I'll put this ATMEGA128 to rubish bin.....I don't want to waste my time....

thanks for the info