Protect Flash memory on ATMEGA2560 (SOLVED)


I've been looking for a few days to find info about this in the net. I downloaded the AVR Studio 5 and bought an AVRISP mkII from the Atmel store to follow the steps they explain on his website to block the security bites. The thing is that when I connect the Arduino Mega with the AVRISP mkII to my computer I can't lock the security bites on AVR Studio 5 cause that option doesnt exist for the ATMEGA2560 as ATMEL show on the tutorials.... So I have no idea how can I do that!!

The idea is to avoid anyone to access the code saved on the flash memory. Anyone knows how this can be done??

That will be much appreciated.


AFAIK, the ATmega2560 has the same security features as the ATmega328; exactly which bytes/bits are you trying to set (or which pages of which tutorials are you looking at)? Note that some "protected" settings won't protect against the bootloader being able to read the code.

AS5 has a bad reputation; you should probably upgrade to 6.1.

You probably want to delete the bootloader and set the non-bootloader lock bits (LB1, LB2) to 0: "Further programming and verification of the Flash and EEPROM is disabled in Parallel and Serial Programming mode. The Boot Lock bits and Fuse bits are locked in both Serial and Parallel Programming mode."

Hi westfw.

I’m looking the tutorial from atmel, attached you will find the page I’m looking at. The bit I’m trying to set is the “Security Bit” from the tutorial. The example is for the AT32UC3L064 and for the atmega2560 this option doesn’t exist…

I wll try it with the avr studio 6.1 and see what happens…

Thanks so much!

The AVR32 is a whole different line of chips. For normal AVR, you probably have to set the individual fuses.

Hi westfw,

You were right men. I also ask the Atmel support and the give me this answer:

"When lock LB bits are set to programmed (0xFC), reading the flash contents will give only “FF"s instead of the application present in the device. Hence your application will not be disclosed.”![

You can see the bites in the attached image, just if this can help anyone.

Thank you.