Can you show us the code that sets up and opens the serial port? If this is a USB to serialport adapter have you tried re-installing the driver for it?