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.

atmega328p lock bits

Status
Not open for further replies.

jelezarov

Member level 1
Joined
Jan 29, 2016
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
313
Hi folks

These are my first steps with AVRs, fuses and lock bits so please don't judge me too hard :)

I have an atmega328p on a breadboard hooked up to Arduino Uno programmed as ISP and I am getting following results for the lock bits:

read with:
Code:
avrdude -patmega328p -cstk500v1 -PCOM18 -b19200 -U lock:r:-:h
shows:

1.Lock bits:
-just after burning a bootloader:
Code:
0xf

- after burning some sketch directly with "upload using programmer":
Code:
0x3f

- after setting the LB1 and LB2 with
Code:
avrdude ... -U lock:w:0xFC:m
the lock byte read is
Code:
0x3c

Code:
avrdude: verifying ...
avrdude: verification error, first mismatch at
         0xfc != 0x3c
avrdude: verification error; content mismatch

Now I suppose the verification error is because the highest two bits are not used and therefore FC (1111 1100) reads as 3C (11 1100) - is that right?

2. Reading the flash
Then after reading the flash with:
HTML:
avrdude ... -U flash:r:out.bin:h
I can read the flash contents before setting the lock bits but after that it reads nothing (out.bin in my example is empty). According to diverse forum sources this should work kind of different - after setting the lock bits it has to be possible to read something, although only garbage.

3. Reprogramming the lock bits/ chip
By all means possible through ISP, so lock bits can be reprogrammed without HVP?



So, what am I doing wrong or everything just works this way?
 

Look at the file after you read the chip.
if it is 01020304.. then the chip is locked.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top