I'm trying to connect an RN-XV wifi module to a duemilenove. I'm finding the software serial interface to be a bit unstable for anything over 9600. I want to use the UART interface in normal operation but without rewriting all of my code. The best solution might be to use an alias, but you can't instantiate/alias the Serial class the way you can SoftwareSerial. I'm a hardware guy
but you can't instantiate/alias the Serial class the way you can SoftwareSerial.
Of course not. Because it has already been done for you (Serial is the only instance of HardwareSerial on the 328-based Arduino. Serial, Serial1, Serial2 and Serial3 are the instances on HardwareSerial on the Mega).
You can declare a reference to an existing instance of a serial port. I do this occasionally to make my Mega projects at least somewhat functionally on regular Arduinos.
#if defined(__AVR_ATmega2560__)
//Serial1 on Mega2560 communicates through Xbee at 57600
HardwareSerial& cmdPort = Serial1;
#else
HardwareSerial& cmdPort = Serial;
#endif
daemach:
you can't instantiate/alias the Serial class the way you can SoftwareSerial. I'm a hardware guy
That's right - your sketch can't instantiate hardware.
There is a predefined Serial object corresponding to the physical serial UART. If you want to do serial output on different pins, you have to do it in software (you can't use the hardware driver) and you can do that using the SoftwareSerial class. You can't use the hardware serial driver to manipulate pins that are not connected to the serial UART, that makes no sense.