P p classvspaceppif you declare a function with

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dy on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an <a class='wikilink' href='http://arduino.cc/en/Hacking/Programmer'>external programmer</a>, replacing the bootloader. </p> <p class='vspace'></p><h3><a name='toc19' id='toc19'></a>Why does my sketch appear to upload successfully but not do anything?</h3> <p>You have selected the wrong item from the Tools > Microcontroller menu. Make sure the selected microcontroller corresponds to the one on your board (either <span class='wikiword'>ATmega8</span> or <span class='wikiword'>ATmega168</span>) - the name will be written on the largest chip on the board. </p> <p class='vspace'></p><p>Check for a noisy power supply. It's possible this could cause the chip to lose its sketch. </p> <p class='vspace'></p><p>Alternatively, the sketch may be too big for the board. When uploading your sketch, Arduino 0004 checks if it's too big for the <span class='wikiword'>ATmega8</span>, but it bases its calculation on a 1 Kb bootloader. You may have a older bootloader that takes up 2 Kb of the 8 Kb of program space (flash) on the <span class='wikiword'>ATmega8</span> instead of the 1 Kb used by the current bootloader. If yours is bigger, only part of the sketch will be uploaded, but the software won't know, and your board will continually reset, pause, reset. </p> <p class='vspace'></p><p>If you have access to an AVR-ISP or parallel port programmer, you can burn the latest version of the bootloader to your board with the <strong>Tools | Burn Bootloader</strong> menu item. Otherwise, you can tell the Arduino environment the amount of space available for sketches by editing the upload.maximum_size variable in your preferences file (see: <a class='wikilink' href='http://arduino.cc/en/Hacking/Preferences'>instructions on finding the file</a>). Change 7168 to 6144, and the environment should correctly warn you when your sketch is too big. </p> <p class='vspace'></p><p><a name='size' id='size'></a> </p><h3><a name='toc20' id='toc20'></a>How can I reduce the size of my sketch?</h3> <p>The <span class='wikiword'>ATmega168</span> chip on the Arduino board is cheap, but it has only 16 Kb of program code, which isn't very much (and 2 Kb is used by the boot...
View Full Document

Ask a homework question - tutors are online