diff --git a/images/att44_cksel.png b/images/att44_cksel.png new file mode 100644 index 0000000000000000000000000000000000000000..6fd0b4d399de1a815ad955cd72afe9e14213d85d Binary files /dev/null and b/images/att44_cksel.png differ diff --git a/images/att44_cksel2.png b/images/att44_cksel2.png new file mode 100644 index 0000000000000000000000000000000000000000..09cd04a0682fed3a54d99a20736440208df7f8d7 Binary files /dev/null and b/images/att44_cksel2.png differ diff --git a/images/att44_cksel3.png b/images/att44_cksel3.png new file mode 100644 index 0000000000000000000000000000000000000000..bf8aea540eca3236a122652534868a733f639306 Binary files /dev/null and b/images/att44_cksel3.png differ diff --git a/images/att44_feb.png b/images/att44_feb.png new file mode 100644 index 0000000000000000000000000000000000000000..381a072b11d33fce6b6ec3346c88cbaeca5df630 Binary files /dev/null and b/images/att44_feb.png differ diff --git a/images/att44_fhb.png b/images/att44_fhb.png new file mode 100644 index 0000000000000000000000000000000000000000..f656ae124e6ace0fc73dededcd4fc490d0ac3a4d Binary files /dev/null and b/images/att44_fhb.png differ diff --git a/images/att44_flb.png b/images/att44_flb.png new file mode 100644 index 0000000000000000000000000000000000000000..ad76307cb8843b6cdaf92b39b056b6d8163c3a04 Binary files /dev/null and b/images/att44_flb.png differ diff --git a/index.html b/index.html index b1af34a1ab22b61bf77ea37d637ac6dbf4806e78..5210ced2bad00514e9d31cc38bae53765b0345e1 100644 --- a/index.html +++ b/index.html @@ -300,6 +300,57 @@ The symbols are: Looking at the individual bits (in groups of 4 since `2^4 = 16`) is typically the main reason for hexadecimal. +### Fuse meanings + +Fuse bits describe low-level configurations. + +There are tools available to figure out what fuses to write, notably Atmel Studio allows you to set those interactively during the programming step with help for each individual fuse of each device they support. +There are also [fuse calculators](http://www.engbedded.com/fusecalc) online. + +But before you jump and set fuses, you should understand what they do, since they can make your micro-controller stay silent forever by disabling programming capabilities or changing the basic clock frequency while expecting a sepcific clock (that may not exist, and then you may need to change the hardware to make it work again). + +Long story short - these are bits you should write carefully because some options are not reversible (or hard to reverse). + +The first part is reading the datasheet about your micro-controller and its section related to fuses (e.g. page 192 of the att44 [datasheet](http://fab.cba.mit.edu/classes/863.09/people/ryan/week5/ATtiny44%20Data%20Sheet.pdf#page=159)). +In our ATTiny44 case, it mentions three different fuse bytes: + +* **Fuse Extended Byte** (extra for self-programming) +* **Fuse High Byte** +* **Fuse Low Byte** + +Let's have a look at the tables: + +<img src="images/att44_feb.png" width="400"> +<img src="images/att44_fhb.png" width="400"> +<img src="images/att44_flb.png" width="400"> + +In our setup, we're just modifying the low byte and choosing value `0x5E`. +Let's deconstruct that: + +`0x5E` is, in binary `01011110`, and the bits start (0-indexed) from the right (least significant bit). + +The last four bits are about the clock selection, and their default `0010` stands for the 8MHz internal RC oscillator as source of the clock. + +In our program above, we're using `1110`, which we can understand by looking at the section on the clock (chapter 6, notably [page 24](http://fab.cba.mit.edu/classes/863.09/people/ryan/week5/ATtiny44%20Data%20Sheet.pdf#page=24)): + +<img src="images/att44_cksel.png" width="400"> + +We're in the last row case (`111` external crystal or resonator), which means we need to go look farther at page 27: + +<img src="images/att44_cksel2.png" width="500"> + +And there we find that we're assuming an external crystal/resonator, with frequency from 8MHz and above. +The last bit `CKSEL0` requires looking a bit further: + +<img src="images/att44_cksel3.png" width="400"> + +Since we have `CKSEL0=0`, it means we assume a ceramic resonator. +Given the additional `SUT1..0=01` (3rd and 4th bits from the left in `01011110`, we know that we have BOD (**B**rown-**o**ut **D**etector) enabled. +You can read about that [there](https://microchipdeveloper.com/8avr:bod). + +The `CKSEL` fuses are the fuses you are the most likely to every change, whereas the other ones are typically very specific. + + </xmp> <script src="sd/strapdown.js"></script> </html>