Error programing Lock bits atmega32

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

I am trying to use lock bits for protection on atmega32.I am not being able to write lock bits to it its giving me verification error while doing it.Can you tell me correct way to do this?

This is the error I am getting while programing:

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

Note that the write fails (and then also the verification).

 

Add -v options to the AVRDUDE command line to get more info. You can add up to four of those, i.e.

avrdude -v -v -v -v ...

 

Please don't post screen shots. Copy avrdude output as text and paste it into a post here.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

You 'Dude people will have to help -- the messages seem to imply that the dude is looking for a file named 0xfc, rather than trying to use a byte with value 0xfc as the lock bit settings?  Is that just the way the dude messages are phrased?

 

A nearly identical thread from 2011:  http://www.avrfreaks.net/forum/s...

The "failure" might have to do with the handling of the don't-care bits?  At least in that thread, the operation was actually carried out correctly.

 

Note that in that thread I don't see an answer on how to read lock bits successfully, like fuse values.  [hmm--haven't fussed in that area much -- are you allowed to read the lock bits when the lock bits are set on an AVR8?]

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Thu. Oct 19, 2017 - 01:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The output shows all the lock bits are already programmed to 0 (verify is 0x00). You cannot unprogram lock bits. They can only be returned to 1 by a chip erase.

"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

joeymorin wrote:
You cannot unprogram lock bits.

LOL! The obvious escaped both Lee and me.

"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

JohanEkdahl wrote:
LOL! The obvious escaped both Lee and me.

To non-dudes, it isn't apparent from the pictured "log" what the state of the AVR is when carried out.

 

Back when I was your age, you couldn't even read the signature of a "locked" AVR.  Nowadays you can.  Can fuses be read from a locked AVR?  Can lock bits be read from a locked AVR?

 

As I always [can't think of an exception] do a full ISP sequence beginning with signature read and erase, I just don't remember.  Perhaps one/more 'Freaks just "know" the answer.  Scanning the Memory Programming section of a representative datasheet, I don't see it addressed.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Signature, calibration byte, fuses, and lock bits can always be read, regardless of the state of lock bits.  Lock bits prevent reading/writing of flash and EEPROM only.

 

EDIT: sp

"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]

 

Last Edited: Fri. Oct 20, 2017 - 03:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry for late reply the problem was with don't care bits in lock bits.

thanks guys for your help.