Interrupt on serial data

Hi,

I am currently embarking on a project to build an UGV. One of the elements in the UGV is an Arduino Mega (one with ATmega1280) running in a loop to read the sensor output of a series of ultrasonic sensors, etc.

Now I am planning to implement a wireless kill switch for the UGV through bluetooth.

Particularly I am looking into a pair of sparkfun BlueSMiRF Bluetooth modems for the connectivty.

The setup I have planned goes like this.

  1. A button press sends an active high to one of the I/Os of an Arduino board.
  2. The Arduino then transmit a string of serial data via a transmitting bluetooth modem to a receiving one.
  3. Upon receiving a specific string, the receiving Arduino then activate certain I/O to stop the UGV.

The problem I have is this,

Normal detection of availability of serial data requires a loop to repeatedly poll the receiving serial input . However, this polling will take up most of the microcontroller's cycles causing problem with the sensor polling.

The kill switch needs to work with a very short time lag between button press and stopping the UGV

Is there someway where I can implement somekind of interrupt that triggers on serial data on one of the I/Os pins?

I gathered that is a NewSoftSerial library that sort of does this. But it only allows for buffering of data in the background, followed by a reading of the buffer.

Thanks very much

If this is a safety kill switch, I certainly wouldn't rely on the existing serial channel, I'd have a separate channel, even possibly a simple R/C servo holding a deadman's handle.

Just for the record, quote from the datasheet

Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.

ematson5897: Just for the record, quote from the datasheet

Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.

That's to keep the insurance premiums down and limit how much blood the lawyers suck out.

Fortunately, the UGV I have planned is no where approaching any scale which is consider automotive.

Anyway I may switch to a very simple on-off 433mhz radio remote for the purpose.

However, I am still curious about this issue about interrupt on serial data.

Some information I have came across are -

  1. The process of uploading sketches onto the Arduino boards have the sort of behaviour that I need, however that is because the DTR pin for the FT232 is connected to the reset pin of the Atmega. Not an interrupt. None of the other flow control pins are connected.
  2. The BlueSMiRF module does not use any flow control, thus the RTS, and CTS pins are usually shorted together. Can the RTS pin somehow be used for the interrupt, and run and ISR that reads the string at the RX pin?

Anyone here have implement something to this effect?

Appreciate any suggestions. Thank you very much.

You are implementing some kind of kill switch. For kill switches a lot of the design considerations for watchdogs apply. So you may want to consider this: http://www.ganssle.com/watchdogs.htm.