Commit 61b693a8 authored by Alexandre Kaspar's avatar Alexandre Kaspar

First version of howto

parents
# programming-helper
Helper about programming your micro-controller
<!doctype html>
<html>
<title>Programming Helper | Index</title>
<xmp theme="simplex">
# How To Program Your Micro-Controller
This is about using `avr-dude`, `make` and getting a high-level understanding of what's happening under the hood so that you can tune your micro-controller yourself.
In practice, you can just read most of what is linked in the **Embedded Programming** class [there](http://academy.cba.mit.edu/classes/embedded_programming/index.html).
In fact, you should have done that already.
But for those who are overwhelmed, we will try to disect some of the content
## References
* [HTMAA's Embedding Programming](http://academy.cba.mit.edu/classes/embedded_programming/index.html)
* [Makefiles](https://makefiletutorial.com/) for executing pre-written commands
* [avrdude](https://www.ladyada.net/learn/avr/avrdude.html) (by Lady Ada) for programming through a programmer
* Existing tutorials for various programmers:
* [Sparkfun's avr programmer](https://learn.sparkfun.com/tutorials/pocket-avr-programmer-hookup-guide/al)
* [AdaFruit's USBTinyISP](https://learn.adafruit.com/usbtinyisp/avrdude)
* [List of AVR IC's and their packages](https://en.wikipedia.org/wiki/ATtiny_microcontroller_comparison_chart)
* [ATtiny10](http://www.digikey.com/product-detail/en/ATTINY10-TS8R/ATTINY10-TS8RCT-ND)
* [ATtiny45V](http://www.digikey.com/product-detail/en/ATTINY45V-10SU/ATTINY45V-10SU-ND)
* [ATtiny44A](http://www.digikey.com/product-detail/en/ATTINY44A-SSU/ATTINY44A-SSU-ND)
* [ATtiny814](http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42721C-AVR-ATtiny417-814-816-817-Datasheet_Complete.pdf)
* [ATmega328P](http://www.digikey.com/product-detail/en/ATMEGA328P-AU/ATMEGA328P-AU-ND) (same as [Arduino Uno](https://en.wikipedia.org/wiki/Arduino_Uno)), ([datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf))
* [ATmega16U2](http://www.digikey.com/product-detail/en/ATMEGA16U2-AU/ATMEGA16U2-AU-ND) (with 16**U* for USB support)
* [ATxmega16E5](http://www.digikey.com/product-detail/en/ATXMEGA16E5-AUR/ATXMEGA16E5-AURCT-ND)
* [ATxmega16A4U](http://www.digikey.com/product-detail/en/ATXMEGA16A4U-AUR/ATXMEGA16A4U-AURCT-ND) (USB support)
## What are those files?
For most base projects of HTMAA, you are provided with a set of different files:
* `file.png` are typically images for tracing (trace) or cutting (outline)
* `file.c` is a C file that contains a C program, which runs on a micro-controller
* `file.make` (or anything ending in `.make`, so here typically `file.c.make` too) is to use the program `make` to call commands that allow you to do things
## What does `XXX` do?
First thing first, you should try reading the manual.
On Mac / Linux, you can access the manual of a specific command typically by typing
```bash
man fancycommand
```
## What is [Make](https://www.gnu.org/software/make/manual/html_node/Introduction.html#Introduction)
References:
* [Make manual](https://www.gnu.org/software/make/manual/make.html)
</xmp>
<script src="sd/strapdown.js"></script>
</html>
#!/usr/bin/env bash
if [[ $# -lt 1 ]]; then
echo "Usage: ./make_html file.md [file.html]"
fi
input="$1"
dir=$(dirname "$input")
name=$(basename "${input%.md}")
[[ -z "$2" ]] && output="$dir/${name}.html" || output="$2"
read -d '' html << EOF
<!doctype html>
<html>
<title>Introduction to Machine Knitting | $title</title>
<xmp theme="simplex">
$(cat "$input")
</xmp>
<script src="sd/strapdown.js"></script>
</html>
EOF
echo "$html" > "$output"
/*******************************************************************
This chunk is to fix Bootstrap so that the Markdown output looks good
*******************************************************************/
body {
padding-top: 60px;
padding-bottom: 40px;
font-size: 15px;
line-height: 150%;
}
xmp, textarea {
display: none;
}
h1,h2,h3,h4 {
margin: 15px 0;
}
pre {
margin: 20px 0;
}
img {
margin: 10px 0;
}
.navbar {
z-index: 1;
}
.table {
width: auto;
}
/*******************************************************************
This chunk is for Google's Code Prettify:
http://google-code-prettify.googlecode.com
*******************************************************************/
/* Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln { color: #000 } /* plain text */
@media screen {
.str { color: #080 } /* string content */
.kwd { color: #008 } /* a keyword */
.com { color: #800 } /* a comment */
.typ { color: #606 } /* a type name */
.lit { color: #066 } /* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun, .opn, .clo { color: #660 }
.tag { color: #008 } /* a markup tag name */
.atn { color: #606 } /* a markup attribute name */
.atv { color: #080 } /* a markup attribute value */
.dec, .var { color: #606 } /* a declaration; a variable name */
.fun { color: red } /* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print, projection {
.str { color: #060 }
.kwd { color: #006; font-weight: bold }
.com { color: #600; font-style: italic }
.typ { color: #404; font-weight: bold }
.lit { color: #044 }
.pun, .opn, .clo { color: #440 }
.tag { color: #006; font-weight: bold }
.atn { color: #404 }
.atv { color: #060 }
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint { padding: 2px; border: 1px solid #888 }
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 { list-style-type: none }
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee }
This diff is collapsed.
This diff is collapsed.
# Bootswatch themes
These themes are all from:
+ http://bootswatch.com
See LICENSE file.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment