Pages: [1] 2 3   Go Down
Author Topic: Why is the reset button required on my 'breadboard arduino'?  (Read 3777 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I recently assembled an 'Arduino on a breadboard' as outlined on one of the pages on the Arduino website. However, I kept getting errors when I tried to upload any sketch. After much searching on these forums, I found that the answer was to hit the physical reset button shortly after you hit the Upload button in the Arduino IDE.

I was just wondering why this is, because you don't have to do that when using the store-bought Arduino boards. Is there something I can do to make it so that I don't have to remember to hit the reset button each time I upload a sketch? Not that this is a huge deal, but it would be nice if I didn't have to. It must be a piece of hardware (electrical component) I'm missing?

Aside from the Breakout Board for FT232RL USB to Serial  - http://www.sparkfun.com/products/718, here's my circuit:



Thanks,
Jamie
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3968
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A 100nF capacitor can be used as shown in the schematic below to create an auto-reset circuit.


* ftdi.png (2.04 KB, 408x394 - viewed 35 times.)
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

See this page:

http://www.gammon.com.au/forum/?id=11637

If you have a 0.1 uF capacitor in series with the RTS line, you shouldn't need the reset button. Halfway down that page I uploaded a sketch without having to press a reset button (I didn't have one).
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you thank you thank you!
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In order for the Arduino to be able to accept the new sketch it has to be running the bootloader.

The bootloader is the first bit of code the Arduino runs after a reboot or power-up.  After a short timeout, if no sketch has been received, the bootloader exits and runs the currently loaded sketch.

Normally the Arduino performs a reset whenever the serial port is opened by the computer.  This is both annoying and convenient.  Convenient in that when you go to upload a sketch the Arduino reboots and enters the bootloader automatically.  Annoying because when you connect your running Arduino to a computer and open the serial port it reboots it, losing any data in the RAM.

So adding the capacitor as mentioned will enable the auto-reboot - it will also enable the wipe-your-Arduino's-RAM function on opening the serial port.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, the whole waiting for a timeout because of the bootloader thing makes sense...in fact, I think that would explain why my sketches take a second or so to run after powering on or resetting when I'm running off of this breadboarded hardware like this. However, what I don't understand is that why is it that the same exact sketch (and chip) runs instantaneously when powering up/rebooting on an actual, store-bought Arduino Duemilanove?

Thanks,
Jamie
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the timeout may be shorter on those - with the auto-reboot function you don't need as long a timeout.  I'm pretty sure there is still a small delay on my UNO.  There are a couple of flashes from the LED while it boots - it's not instant, but it's pretty quick.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

However, what I don't understand is that why is it that the same exact sketch (and chip) runs instantaneously when powering up/rebooting on an actual, store-bought Arduino Duemilanove?

Could have a different bootloader on it.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can't be different bootloader because i can take the chip off of the store-bought board and move it to the breadboard and there is a delay on the breadboard circuit when powering on, but no delay when it was on the actual store-bought board when powering it on with the same chip.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Put a pull-up resistor on Rx (D0 or pin 2 on the chip).
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since I'm a noob, I'm still trying to figure out the whole pull-up / pull-down resistor stuff - could you elaborate a little more please? What kind of resistor (1/4W?, how many ohms), and do I connect it to ground or +5V?

Thanks,
jamie
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

10K (the exact value doesn't matter much) between the pin and +5V. That is a "pull-up" because it weakly pulls the pin "up" to 5V. A "pull-down" would be tied between the pin and Gnd.

The reason for 10K (rather than, say 10 ohms) is the current it would draw if the pin happened to be configured as an output and set low.

Using Ohm's Law, I = E/R the current would be 5 / 10000 which is 0.5 mA. However if you used 10 ohms it would be 5/10, which is half an amp (which the pin can't handle).

So, since it is 0.5 mA the wattage will be low (5 * 0.5 mA = 2.5 mW) and thus a 1/4 W resistor (250 mW) would be plenty.

The reason for it is, without it the line (Rx) will probably have noise on it, and the bootloader will take a few seconds trying to make sense of the noise before it gives up.

Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I = E/R

E?  Do you use different units down under?

E is energy, isn't it?  V is volts.

I = V/R
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.the12volt.com/ohm/ohmslaw.asp

You may as well say it is:

A = V / Ω

I is current (measured in amps (A))
E is voltage (measured in volts (V))
R is resistance (measured in ohms (Ω))
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also see:

http://www.onlineconversion.com/ohms_law.htm

I admit there are other sites that use V for voltage (and hey, I wish it had been that way from the start!).
Logged

Pages: [1] 2 3   Go Up
Jump to: