@@ -247,7 +247,57 @@ The manual is slightly more verbose and tells us what's available for the memory
<imgsrc="images/avrdude_u.png"width="600">
In our case, `program-usbtiny` uses the following update command:
```bash
-U flash:w:hello.ftdi.44.echo.c.hex
```
which means:
* Updating the `flash` memory
* **W**riting to it (not **r**eading nor **v**erifying)
* Using the hex file `hello.ftdi.44.echo.c.hex` that got generated
Why the `flash` memory?
You should read this [memory part](https://en.wikibooks.org/wiki/Embedded_Systems/Atmel_AVR#Memory) of the Embedded Systems from Wikibooks.
And you will definitely need to read the *datasheet* of your target micro-controller.
As a summary, there are different types of memory available. For the simple AVR systems, there are:
* **data** memory, I/O registers and SRAM - those are dynamic, changing during execution, and vanishing upon shutdown (aka *volatile* memory)
* **flash** program memory - this is where your program goes
* **[EEPFROM](https://en.wikipedia.org/wiki/EEPROM)** aka Electrically Eraseable Programmable Read-Only Memory, which allows you to store data that survives a restart / shutdown
* **fuses** are special types of memory that cannot be modified by the program and must be programmed separately
For interested readers:
* [flash vs eeprom](https://electronics.stackexchange.com/questions/69234/what-is-the-difference-between-flash-memory-and-eeprom/69275)
### avrdude and fuses
Fuses are specific bits of the memory that specify low-level configurations.
Thoses have to be programmed separately from the main program memory.
In our previous example with the ATTiny44, the fuse programming was done with the `program-usbtiny-fuses` target:
```bash
program-usbtiny-fuses: $(PROJECT).hex
avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x5E:m
```
Here, the `-U` command targets the **low** bits of the fuse memory for the ATTiny44.
The actual value is specified as a hex number: `0x5E`.
### Hexadecimal Numbers
Hex numbers are numbers in hexadecimal base (16) and are typically prefixed with `0x`.