How can i see lock bits with usbasp?

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

Hello,I am using attiny microcontroller.
Such as low fuse bytes are read with this code :
C:\WinAVR-20100110\bin\avrdude -c usbasp -p t84 -U lfuse:r:lfuse.hex:i -v

So what code is required for reading lock bits?
 

Last Edited: Mon. Aug 17, 2020 - 03:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to AVRFreaks!

lock bits are read just like any other fuse using the lock keyword

 

 hfuse

    The high fuse byte.
lfuse

    The low fuse byte.
lock

    The lock byte.
signature

    The three device signature bytes (device ID).

hfuse

lfuse

lock

signature

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

Last Edited: Mon. Aug 17, 2020 - 03:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks

Last Edited: Tue. Aug 18, 2020 - 09:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have read lock bits.I have done 0xfc. (11111100)
But result: for lock.hex

:01000000E21D
:00000001FF

If I change 0x00 result is same.why the result is the same

The reason I did not open this thread is that I did it 0x00 instead of 0xfc in an attempt.But I can see that there is no difference.What do you think is the correct usage? 0x00 or 0xfc?The goal is just to make bit 0 and bit 1 0.My microcontroller attiny85.

Last Edited: Tue. Aug 18, 2020 - 01:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Well that file contains the single value 0xE2. But of course, because of:

 

 

six of the bits are "don't care" so can be ignored. So if E2 = 11100010 the only bits of any significance appear to be ??????10 so LB2 is 1 (inactive) and LB1 is 0 (active).

 

PS are you *sure* about using such an old version of avrdude? You might want to install "Arduino" simply because (among other things) it will deliver a much more up to date copy of avrdude.exe (and more importantly avrdude.conf).

Last Edited: Tue. Aug 18, 2020 - 12:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you are right, but I'm asking these for a job I've done before.

I want to LB1=0 and LB2=0.

i did it like this: C:\WinAVR-20100110\bin\avrdude -c usbasp -p t84 -Ulock:w:0x00:m    0x00=00000000

But I guess I should have done this: C:\WinAVR-20100110\bin\avrdude -c usbasp -p t84 -Ulock:w:0xFC:m    0xFC=11111100

I'm worried there might be a problem about operating of system .Software protection is valid, there is no problem so far.

as a result:
1)Which is the correct usage? 0x00 or 0xfc ? or it doesn't matter about operating of system.
2)Am I in vain worried that I use a 0x00 instead of a 0xfc? (for operating of system)
3)I will tried this command reading states of lock bits : C:\WinAVR-20100110\bin\avrdude -c usbasp -p t84 -U lfuse:r:lock.hex:i -v
But I have reached same results for 0x00,0xfc and 0xff. result of lock.hex : :01000000E21D
:00000001FF Why?I don't understand.
 

Last Edited: Tue. Aug 18, 2020 - 02:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hrn97ta wrote:
C:\WinAVR-20100110\bin\avrdude -c usbasp -p t84 -U lfuse:r:lock.hex:i -v

 

Should that have been: -p t85 (was this a typing mistake?) Or did you copy / paste your actual command?  Use copy/paste when you can to prevent typo's!

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

I also worked with two microcontrollers.This is not important.You might think t84.