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

Hello!

Is it possible to (temporarily) disable the software reset feature that occurs when a serial connection is made?  (I'm using an Arduino Diecimila.) I have an application that periodically sends serial data to the Arduino, and it causes all the LEDs to flicker, and in rare cases the serial data I send is not received (I'm waiting 8 seconds after the serial connection before sending the data...)

Thanks!
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It might be.  What operating system are you on?  What's your application written in?

Can you simply keep the serial connection open the whole time?
Logged

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

Hi!

Quote
It might be.  What operating system are you on?  What's your application written in?
At the moment I'm using OS X.  My application uses Tod's arduino-serial (http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/) to send information to the Arduino from a simple perl script.   (The perl script SSHes into a remote server and gathers some stats to display on the Arduino.)

Quote
Can you simply keep the serial connection open the whole time?
Keeping a serial connection constantly open is one possible workaround, but I was wondering if there's a way to temporarily disable the Arduino's software reset so that I would not have to have keep the serial connection open.

Thanks!
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 12
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There's a way, but it's a bit complicated.

The software reset happens because the reset line of the ATmega is connected to the DTR line of the serial connection (coming from the FTDI chip) via a capacitor.  Whenever the DTR line drops, the chip resets.  The FTDI drivers lower the DTR line whenever you open the connection.  If, however, you set HUPCL when the connection is open, the line will not be raised when the connection is closed.  Thus, the next time you open the connection, the line will already be low, so it won't fall and reset the chip.  You can set HUPCL from C, but I don't have the syntax handy.
Logged

Pages: [1]   Go Up
Jump to: