Second Serial connection on Duemilanove?

Hey,

I have a Duemilanove with a XBee board on top. From my understanding, the board communicates with the XBee via ICSP. Works fine, but now I like to add a second RS232 connection with another machine. To put it short, the board reads data from that machine, then sends it with the XBee.

The RX and TX pins are free, but I wonder how to program this second connection, since for the XBee I'm already using
Serial.begin( ... ) and such.

The "multiSerialMega" example shows how to use a second port; "Serial1.begin ...". But when I try that in my code, I get this error message:
"Serial1 was not declared in this scope"
Is it possible to use a second connection at all on the Duemilanove?

Rick

You can use NewSoftSerial to create a software-based serial port, using any two pins.

From my understanding, the board communicates with the XBee via ICSP.

Not true. It communicates using the RX/TX pins.

Thanks for that link! It tells that using multiple Serial connections are hard to handle due speed. But traffic on both ports will be little, although in the worst case I receive from both devices at the same time... Don't know if that could be a real problem, other than that the program isn't doing much. Or is this problem only occuring when using multiple SOFTWARE connections anyway?

So the Duemilanove has only 1 hardware Serial connection then? I thought the XBee board was driven by ICSP, but now that I'm looking better... You're right. Of course you are!

Thanks for the information,
Rick

Using one hardware and one software serial connection should work quite well, as long as the volume of data is not such that 90% of the Arduino's time is consumed doing serial communication.

Another option: you can get UARTs that connect to the Arduino through SPI or I2C. I think Sparkfun even has one that's already mounted on a small PC board.