Pages: [1]   Go Down
Author Topic: reset when serial unavailable?  (Read 885 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all:

I've written a stationery bicycle computer app that processes my reed switch data, and then sends a stream of data to a Processing app for display.

I've noticed that whenever I stop and/or restart my Processing app, the total ride-time as calculated by my Arduino resets itself. Does this have something to do with the serial connection being reset?

Is there a way I can make Arduino keep running its program regardless of whether or not Processing is listening on the other end?

Thanks
Adam
Logged

Holland
Offline Offline
Sr. Member
****
Karma: 0
Posts: 439
Arduino likes cookies too
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When you say serial, do you mean through the USB cable, or the rx-tx pins?
I've noticed the resetting behaviour on the USB cable (when also having the arduino powered through an external supply), but not when using a serial device on the rx-tx pins (bluetooth for instance).
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hm, interesting. Yes, I'm using USB. Ideally I'd like to be able to connect the device to USB to "upload" my ride, but then have the freedom to disconnect, go for a ride, and then plug it back in again. Is that possible?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 638
Posts: 50304
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are ways to disable the auto-reset feature. Search the forum for auto-reset.

There are drawbacks to doing this. You'll have to decide whether they outweigh the benefits, or not.

You could log data to an SD card, which could then be removed for copying, without causing the Arduino to reset.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 24
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, Paul. I didn't know the term was "auto-reset", so that will help!

The SD card option is a good one, except that then I can't do live data plotting when riding stationary. I'm hoping to set it up so that I can go for rides outdoors if I want to, but also ride in-place with a big graphical display if I prefer.
Logged

UK
Offline Offline
God Member
*****
Karma: 0
Posts: 710
Arduino is Genius
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The solution of disabling auto-reset is good.

A free alternative to SD is to use the on board EEPROM.
You could stash values away in there, and pick up where it leaves off. You could even switch the power off.
You would have to figure out when to store, but you'd have the same problem with SD.

There is a little library to use it
http://www.arduino.cc/en/Reference/EEPROM
It only has 512 bytes, but probably enough.

HTH
GB
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 5594
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think there are versions of the Arduino out there that have switches/jumpers to allow you to enable/disable the auto-reset functionality; while you could likely mod a standard Arduino to disable the auto-reset, or hack in such a reversible mod, it might be better to track down a board with it already built in (probably something from Seeedstudio)...

Ah - here it is (out of stock, tho):

http://www.seeedstudio.com/depot/seeeduino-v328-fully-assembledatmega-328-p-439.html?cPath=27
« Last Edit: April 23, 2010, 05:02:33 pm by keeper63@cox.net » Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Pages: [1]   Go Up
Jump to: