No video

AVR Fuse & Lock bytes [ATMega328/P, Arduino]

www.udemy.com/...
In today's lesson, we shall learn about the Fuse and lock bytes. The lesson is accompanied by a hands-on session in which you shall program the fuse and lock bytes. This will configure the atmega328 for further usage.
There are four bytes in a separate non-volatile memory area which is used to secure the code in the microcontroller and configure it. One of those bytes is lock byte while other three are fuse bytes.
Lock byte is used to restrict the access to the Flash and EEPROM and provides security against unauthorized access to the on-chip memory. The access restriction can be applied at three levels - no restriction, disable programming, that is write operation, in parallel & serial programming modes & disable programming & verification, basically read and write operation, in both the programming modes. Lock byte is also used to restrict the access of the two sections of flash memory those are the Application section and Bootloader section. For our purpose, the desired value of the lock byte is 0x3F.
Fuse bytes are used to configure the microcontroller. There are three fuse bytes named extended fuse byte, fuse high byte and fuse low byte and are identified using efuse, hfuse & lfuse, respectively, while programming. The 5 most significant bits of efuse are unused and rest three bits are used to configure the trigger level of Brown-out detector. We shall program the fuse byte with value 0xFD.
The fuse high byte is used to enable or disable external reset, debugWire, serial program and data downloading and EEPROM data preservation through chip erase. It is also used to configure the size of bootloader section and select the reset vector. The lfuse is programmed with value 0xDE.
The fuse low byte is used to enable or disable divide clock by 8 and Clock output. It is also used to select the start-up time and clock source. We shall program the fuse byte with 0xFF.
It is important that fuse and lock bytes are programmed with the values mentioned. For example, the default value of clock select in fuse low byte selects the internal RC oscillator at 8MHz. But we are using 16MHz external crystal oscillator so the clock select must be initialized with binary value 111.
We have already wired the base circuit with in-circuit programmer and learned about the AVRDUDE. Let's check the value of fuse and lock bytes and program those as necessary. Connect the development board to the development PC through the in-circuit programmer and use the command shown.

Пікірлер: 13

  • @PinakiGupta82Appu
    @PinakiGupta82Appu3 жыл бұрын

    Informative, clear and concise. Thanks!

  • @studioborosoft3973
    @studioborosoft39732 ай бұрын

    I played with the fuses on the mega2560 through uspasp and completely blocked my access to the chip. Can you advise how to return it to its original state. Thank you

  • @rongarza9488
    @rongarza94883 жыл бұрын

    Excellent presentation!

  • @webslinger2011
    @webslinger20114 жыл бұрын

    Hi! So these fuses can be set back so the microcontroller can resume programming again? Thanks!

  • @enochyamoah7239

    @enochyamoah7239

    Жыл бұрын

    You can reset the lock bits to read the program again?

  • @sushantasarkar123
    @sushantasarkar123 Жыл бұрын

    What is problem in my Atmega328P-U microcontroller. I am using external 16mhz crystal . I am using this setting 0xFF, 0xDE, 0xFD, 0xC0 and write by avrdude. my project stuck or hang after some hour... how to solve my problem...plz tell me

  • @msbanda2123
    @msbanda2123 Жыл бұрын

    Super useful 👍

  • @varabinda

    @varabinda

    19 күн бұрын

    I am happy, it helped you. Watch for more videos.

  • @saitamapreetsingh3057
    @saitamapreetsingh30572 жыл бұрын

    Thanks bro !

  • @Kris0725PL
    @Kris0725PL2 жыл бұрын

    How to repair 328p with device id 0x00000 error?

  • @mishankgautam2098
    @mishankgautam20983 жыл бұрын

    In my system , 'avrdude' is not recognised as an internal pr external command operable program or batch file

  • @TheSHEKHAR98

    @TheSHEKHAR98

    2 жыл бұрын

    instal the avr dude software and add it to the path

  • @mishankgautam2098
    @mishankgautam20983 жыл бұрын

    Please suggest something