user46: The strangest thing is happening to a standalone Arduino board that I designed and built. The board (whose schematics are below) has the following features:

It has a ATmega328P with a 5V voltage regulator and usual circuitry when set up as a standalone controller. 
It controls a scoreboard with several 7-display digits linked through the connectors on the right (JP1 through JP12). 
It has cursor buttons decoded using a voltage ladder through ANALOG_0 (A0).
It has a Real Time Clock to keep time when it's turned off.
It has an RF receiver module.
It has a UART header (JP17) so I can program the board using a serial port.
It has a speaker attached to digital pin 3 (D3). 


I upload sketches to it using a RS232-to-TTL adapter that I've also built (schematics also below) and a Serial-to-USB cable. When programming it, the board behaves much like a Severino board.

What's strange is that, when I upload a sketch, the process is paused in the middle and then the speaker starts to beep continually. It pauses with the following avrdude messages:
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch
     System wide configuration file is "C:\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf"

     Using Port                    : \\.\COM1
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

When I press reset on the board, avrdude continues outputting its messages (such as below), the beep stops, the upload continues and the sketch is uploaded successfully to the board.
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
... messages and upload continue and completes successfully.

I don't have the rest of the messages handy here, but I hope you get the idea.
So, my questions are:

What is making the upload process pause?
Why is the buzzer beeping when the process pauses?


user46: I'm not sure but the problem may also be related to the auto-reset feature of the converter board.
I copied the converter board design from the Arduino Severino and according to its manual, the serial communication must be set to 19,200 bps for the auto-reset feature to work.

Be sure that computer COM Port speed is set to 19200bps otherwise
  auto reset will not work properly.

Well, I'm using 115,200, so that must be a problem.

user379: 
What is making the upload process pause?

Well, given all the comments made under your question, this is definitely a tricky one. You might want to try to add a decoupling capacitor as suggested by @jfpoilpret, though your schematics look alright to me… (maybe ask a review of it on EE SE).
I'd also advice you to copy the avrdude command from Arduino IDE output (you'll find it at the top), and run it in the command shell with lower bitrate:
avrdude -v -v -v -v -C "C:\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf" -P COM1 -patmega328 -U… -B3 -b115200

the higher the -B value is the lower your bitrate is. and -b to the correct baudrate for your bootloader (are you sure this is 115200? it's more common to see 57600).
Did you also set fuses correctly? You might as well want to check the values of the fuses to see if the clocks are correctly set up:
avrdude -U lfuse:r:-:i -U hfuse:r:-:i -U efuse:r:-:i

which will output the values of the fuses. Then to make the values readable, put the values at the bottom of the form on the fuse calculator site, after choosing the Atmega328P MCU from the dropdown list.
Double check that:

you have enough size for the bootloader (usually the more you give it the better it is) ;
you have correctly set up the cristals configuration for your design (which may not be compatible with default Uno settings as setup by the Arduino IDE), checking if you correctly set up the external crystal at 16MHz…


Why is the buzzer beeping when the process pauses?

It's because when the processor does not have the output set up, the values within the registers are in an undefined and unpredictable state. Which means that usually it keeps the last value it had before a reset, or changed state because of some electrostatic weirdness, or is giving some weird PWM output because of the influence of a clock nearby.
So basically, there's something wrong happening when you're uploading your code and that wrong thing has an indirect effect on the audio. I wouldn't worry much about that stuff, but more about the cause of the pausing.
Sadly, I don't have a direct answer for you, but at best a few paths you should investigate more. HTH

user46: I finally found what was causing the problem: the reset signal from pin 4 (DTR - Data Terminal Ready) on the DB9-Female connector was spiking up to 10V before going to 0V and was triggering high-voltage programming on the ATmega. Below is a scope shot showing the situation:

The yellow trace is DTR signal while the green trace is the RESET signal on the ATmega.
According to Atmel's Atmel AVR042: AVR Hardware Design Considerations application note, one should add an ESD diode between ATmega's RESET and Vcc to prevent the reset signal from triggering high-voltage programming mode, like so:

After adding such a small signal diode (1N4148) like the app note recommended, I got the issue fixed. See below the scope shot taken after the diode was added.

Now the 10V peak is gone. 
That was a tricky one!! But I could never find what was wrong without research and the right tools. Money on a scope is money well spent!!

46: <p>The strangest thing is happening to a standalone Arduino board that I designed and built. The board (whose schematics are below) has the following features:</p>

<ol>
<li>It has a ATmega328P with a 5V voltage regulator and usual circuitry when set up as a standalone controller. </li>
<li>It controls a scoreboard with several 7-display digits linked through the connectors on the right (JP1 through JP12). </li>
<li>It has cursor buttons decoded using a voltage ladder through ANALOG_0 (A0).</li>
<li>It has a Real Time Clock to keep time when it's turned off.</li>
<li>It has an RF receiver module.</li>
<li>It has a UART header (JP17) so I can program the board using a serial port.</li>
<li>It has a speaker attached to digital pin 3 (D3). </li>
</ol>

<p><img src="https://i.stack.imgur.com/21kgT.png" alt="Controller schematics"></p>

<p>I upload sketches to it using a RS232-to-TTL adapter that I've also built (schematics also below) and a Serial-to-USB cable. When programming it, the board behaves much like a <a href="http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3" rel="noreferrer">Severino board</a>.</p>

<p><img src="https://i.stack.imgur.com/h3HJq.png" alt="enter image description here"></p>

<p>What's strange is that, when I upload a sketch, the process is paused in the middle and then the speaker starts to beep continually. It pauses with the following avrdude messages:</p>

<p>avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, <a href="http://www.bdmicro.com/" rel="noreferrer">http://www.bdmicro.com/</a>
         Copyright (c) 2007-2009 Joerg Wunsch</p>

<pre><code>     System wide configuration file is "C:\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf"

     Using Port                    : \\.\COM1
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200
</code></pre>

<p>When I press reset on the board, avrdude continues outputting its messages (such as below), the beep stops, the upload continues and the sketch is uploaded successfully to the board.</p>

<pre><code>avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
... messages and upload continue and completes successfully.
</code></pre>

<p>I don't have the rest of the messages handy here, but I hope you get the idea.</p>

<p>So, my questions are:</p>

<ol>
<li><strong>What is making the upload process pause?</strong></li>
<li><strong>Why is the buzzer beeping when the process pauses?</strong></li>
</ol>
 46: <p>I'm not sure but the problem may also be related to the auto-reset feature of the converter board.</p>

<p>I copied the converter board design from the <a href="http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3" rel="nofollow">Arduino Severino</a> and according to <a href="http://arduino.cc/en/uploads/Main/ArduinoSeverinoManual2.pdf" rel="nofollow">its manual</a>, the serial communication must be set to 19,200 bps for the auto-reset feature to work.</p>

<blockquote>
  <p>Be sure that computer COM Port speed is set to 19200bps otherwise
  auto reset will not work properly.</p>
</blockquote>

<p>Well, I'm using 115,200, so that must be a problem.</p>
 379: <blockquote>
  <p>What is making the upload process pause?</p>
</blockquote>

<p>Well, given all the comments made under your question, this is definitely a tricky one. You might want to try to add a decoupling capacitor as suggested by @jfpoilpret, though your schematics look alright to me… (maybe ask a review of it on <a href="http://electronics.stackexchange.com">EE SE</a>).</p>

<p>I'd also advice you to copy the <code>avrdude</code> command from Arduino IDE output (you'll find it at the top), and run it in the command shell with lower bitrate:</p>

<pre><code>avrdude -v -v -v -v -C "C:\arduino-1.0.3\hardware/tools/avr/etc/avrdude.conf" -P COM1 -patmega328 -U… -B3 -b115200
</code></pre>

<p>the higher the <code>-B</code> value is the lower your bitrate is. and <code>-b</code> to the correct baudrate for your bootloader (are you <em>sure</em> this is 115200? it's more common to see 57600).</p>

<p>Did you also set fuses correctly? You might as well want to check the values of the fuses to see if the clocks are correctly set up:</p>

<pre><code>avrdude -U lfuse:r:-:i -U hfuse:r:-:i -U efuse:r:-:i
</code></pre>

<p>which will output the values of the fuses. Then to make the values readable, put the values at the bottom of the form on the <a href="http://www.engbedded.com/fusecalc/" rel="nofollow">fuse calculator site</a>, after choosing the <code>Atmega328P</code> MCU from the dropdown list.</p>

<p>Double check that:</p>

<ul>
<li>you have enough size for the bootloader (usually the more you give it the better it is) ;</li>
<li>you have correctly set up the cristals configuration for your design (which may not be compatible with default Uno settings as setup by the Arduino IDE), checking if you correctly set up the external crystal at 16MHz…</li>
</ul>

<blockquote>
  <p>Why is the buzzer beeping when the process pauses?</p>
</blockquote>

<p>It's because when the processor does not have the output set up, the values within the registers are in an undefined and unpredictable state. Which means that usually it keeps the last value it had before a reset, or changed state because of some electrostatic weirdness, or is giving some weird PWM output because of the influence of a clock nearby.</p>

<p>So basically, there's something wrong happening when you're uploading your code and that wrong thing has an indirect effect on the audio. I wouldn't worry much about that stuff, but more about the cause of the pausing.</p>

<p>Sadly, I don't have a direct answer for you, but at best a few paths you should investigate more. HTH</p>
 46: <p>I finally found what was causing the problem: the reset signal from pin 4 (DTR - Data Terminal Ready) on the DB9-Female connector was spiking up to 10V before going to 0V and was triggering high-voltage programming on the ATmega. Below is a scope shot showing the situation:</p>

<p><img src="https://i.stack.imgur.com/IM3RF.png" alt="Scope shot showing voltage spike to 10V"></p>

<p>The yellow trace is <code>DTR</code> signal while the green trace is the <code>RESET</code> signal on the ATmega.</p>

<p>According to Atmel's <a href="http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_application-note_avr042.pdf" rel="nofollow noreferrer">Atmel AVR042: AVR Hardware Design Considerations application note</a>, one should add an ESD diode between ATmega's <code>RESET</code> and <code>Vcc</code> to prevent the reset signal from triggering high-voltage programming mode, like so:</p>

<p><img src="https://i.stack.imgur.com/GJuGd.png" alt="Recommended RESET pin connection for ATmegas"></p>

<p>After adding such a small signal diode (1N4148) like the app note recommended, I got the issue fixed. See below the scope shot taken after the diode was added.</p>

<p><img src="https://i.stack.imgur.com/kwpzB.png" alt="Scope shot after fixing the board"></p>

<p>Now the 10V peak is gone. </p>

<p>That was a tricky one!! But I could never find what was wrong without research and the right tools. Money on a scope is money well spent!!</p>
