Go Down

Topic: Resettings Fuses And Lock Bits (Read 26721 times) previous topic - next topic

CrossRoads

"
ATmega88A/88PA/168A/168PA/328/328Pprovides six

Lock bits. These can be left unprogrammed ("1") or can be programmed ("0") to obtain the additional features

listed in Table 28-2. The Lock bits can only be erased to "1" with the Chip Erase command."
0x3F = 0011 1111 - so all 6 bits unlocked.  I don't know what you  have set up that is causing them to lock. A standard bootload using the IDE will not lock them.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

avocadobeta

i've got 0x0f in lock bits after loading bootloader from Arduino IDE and I was unable to load something to my ATmega328P from Atmel Studio. After erasing memory by avrdude lock bits have been 0x3f..


avocadobeta

I think everything is OK. Just it is difficult to find problems when you play with different tools. If you are using only Arduino IDE evething is OK. If you want to play you must have fun to find something ...

JakeSoft

i've got 0x0f in lock bits after loading bootloader from Arduino IDE and I was unable to load something to my ATmega328P from Atmel Studio. After erasing memory by avrdude lock bits have been 0x3f..


That much at least makes sense. The upper two lock bits aren't used anyway, so it probably doesn't matter what those are set to. It looks like the lower six bits are all "cleared" to their "unprogrammed" state after erase and set to 1. That seems to agree with the datasheet I've been reading.

westfw

Quote
Rd - - BLB12 BLB11 BLB02 BLB01 LB2 LB1
Right.  And the "Burn Bootloader" command sets that byte to 0x0F (0b001111), which means that it has zero'ed (enabled)
BLB12 and BLB11 (*not* LB2/LB1)
Having BLB1 set to zero means "SPM is not allowed to write to the Boot Loader section, and LPM executing from the Application section is not allowed to read from the Boot Loader section." according to the data sheet,
 
BLB0 is 0b11, meaning "No restrictions for SPM or LPM accessing the Application section."
and LB is 0b11, meaning "No memory lock features enabled."


 

JakeSoft

I wired up my USBTinyISP as shown in post #3, but I don't think the programmer is even working.

I get the same error when I attempt to burn bootloader from the Arduino IDE or use AVRDUDE command line:

avrdude: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.


Command line was:
avrdude -patmega328p -cusbtiny -Uflash:r:d:\hexfiles\tinybackup.hex:i

Operating system is Windows 7 Pro, 64-bit

Connecting to a Pro Mini 3.3V @ 8MHz.

I have the blink sketch uploaded to the Pro mini and when I run the command line, I can see that the steady blinking LED is interrupted momentarily, so that makes me think that at least reset is being pulled low briefly. Any ideas?

JakeSoft

I wired up my USBTinyISP as shown in post #3, but I don't think the programmer is even working.

I get the same error when I attempt to burn bootloader from the Arduino IDE or use AVRDUDE command line:

avrdude: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.


Command line was:
avrdude -patmega328p -cusbtiny -Uflash:r:d:\hexfiles\tinybackup.hex:i

Operating system is Windows 7 Pro, 64-bit

Connecting to a Pro Mini 3.3V @ 8MHz.

I have the blink sketch uploaded to the Pro mini and when I run the command line, I can see that the steady blinking LED is interrupted momentarily, so that makes me think that at least reset is being pulled low briefly. Any ideas?
Disregard. I think I've got it working now. Right after I posted this, I found this article: https://learn.adafruit.com/usbtinyisp/help

Using the -B32 trick on the command line did the trick!

Go Up