User Tools

Site Tools


tutorials:library:arduino:bootloader.html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tutorials:library:arduino:bootloader.html [2011/04/14 21:12]
daigo created
tutorials:library:arduino:bootloader.html [2016/01/28 18:05] (current)
Line 3: Line 3:
  
  
-[[http://​www.ladyada.net///​Adaboot328.zip|Here is the package for a 'fixed up' ATmega328 bootloader]]. To program it you may need to change the Makefile'​s ISPTOOL, etc definitions. The commands are **make adaboot328; make TARGET=adaboot328 isp328** (I couldn'​t get the default '​isp'​ target to work so I made a new one)+[[http://​www.ladyada.net/​library/arduino/​Adaboot328.zip|Here is the package for a 'fixed up' ATmega328 bootloader]]. To program it you may need to change the Makefile'​s ISPTOOL, etc definitions. The commands are **make adaboot328; make TARGET=adaboot328 isp328** (I couldn'​t get the default '​isp'​ target to work so I made a new one)
  
  
Line 29: Line 29:
     uint8_t ch,ch2;     uint8_t ch,ch2;
     uint16_t w;     uint16_t w;
-<​strong>​+
     ch = MCUSR;     ch = MCUSR;
     MCUSR = 0;     MCUSR = 0;
Line 49: Line 49:
  else if(ch=='​Q'​) {  else if(ch=='​Q'​) {
    nothing_response();​    nothing_response();​
-<​strong>​+
    // autoreset via watchdog (sneaky!)    // autoreset via watchdog (sneaky!)
    WDTCSR = _BV(WDE);    WDTCSR = _BV(WDE);
Line 64: Line 64:
  
  
-You can also just grab the [[ATmegaBOOT_168.c|source code]] and [[http://​www.ladyada.net///​ATmegaBOOT_168_ng.hex|compiled hex file here.]]+You can also just grab the [[ATmegaBOOT_168.c|source code]] and [[http://​www.ladyada.net/​library/arduino/​ATmegaBOOT_168_ng.hex|compiled hex file here.]]
  
 It will work in NG or Diecimila Arduinos ​ It will work in NG or Diecimila Arduinos ​
Line 89: Line 89:
     uint8_t ch,ch2;     uint8_t ch,ch2;
     uint16_t w;     uint16_t w;
-    ​**uint8_t firstchar = 0;**+    uint8_t firstchar = 0;
   
  .....  .....
Line 95: Line 95:
  /* Hello is anyone home ? */   /* Hello is anyone home ? */ 
  if(ch=='​0'​) {  if(ch=='​0'​) {
-   ​fi**rstchar ​= 1; // we got an appropriate bootloader instruction**+   ​firstchar ​= 1; // we got an appropriate bootloader instruction
    nothing_response();​    nothing_response();​
-<​strong>​else if (firstchar == 0) {+ }else if (firstchar == 0) {
    // the first character we got is not '​0',​ lets bail!    // the first character we got is not '​0',​ lets bail!
    // autoreset via watchdog (sneaky!)    // autoreset via watchdog (sneaky!)
    WDTCSR = _BV(WDE);    WDTCSR = _BV(WDE);
    while (1); // 16 ms    while (1); // 16 ms
- }</​strong>​+ }
 </​code>​ </​code>​
  
  
  ​\\ ​  ​\\ ​
-You can also just replace the last two lines with <strong class="​style2">​app_start()</​strong>​ +You can also just replace the last two lines with **app_start()**
  
  
/home/ladyada/public_html/wiki/data/attic/tutorials/library/arduino/bootloader.html.1302815561.txt.gz · Last modified: 2016/01/28 18:05 (external edit)