write data to serial port