Certain serial data not received

Hi everybody,

I'm trying to remake a pagerprogrammer. The original device comes with software which communicates with the device via a serial port. At startup it sends some data to a comport to find the device, if it is not found, the program won't start.

My problem is that I can't receive the data coming from the program, so I can't let it know a device is present. When I send data via the Arduino serial monitor however, data is being received.

When I monitor my comport,the only difference seems to be the following packets:

Data from softwareprogram: 353331: I/O Request (DOWN), 2016-12-27 11:19:13,5396423 +0,0000014 (1. Device: USB-SERIAL CH340 (COM3)) IOCTL_SERIAL_SET_HANDFLOW: Set handshake information ControlHandShake=1 FlowReplace=2147483712 XonLimit=34412 XoffLimit=8603

Data from Arduino serial monitor: 353289: I/O Request (DOWN), 2016-12-27 11:18:59,3978790 +0,0000019 (1. Device: USB-SERIAL CH340 (COM3)) IOCTL_SERIAL_SET_HANDFLOW: Set handshake information ControlHandShake=1 FlowReplace=2147483712 XonLimit=2048 XoffLimit=512

Can this be the source of the problem?

The sketch I use is very basic,

void setup(){
  Serial.begin(9600);

  pinMode(13,OUTPUT);
  digitalWrite(13,LOW);
}

void loop() { 
}

void serialEvent() {
  while (Serial.available()) {
      digitalWrite(13,HIGH);
  }
}

On both the Uno and Nano I get the same results. (both have CH340 chip)

Thanks and a happy newyear in advance!

On both the Uno and Nano I get the same results. (both have CH340 chip)

No, both do not have that chip, so it must be a module you added. Please provide information about what USB2Serial module you're using.

I guess the problem you have is the boot loader. The Arduino hardware is designed to provide a reset signal to the Arduino when the serial interface on the PC is opened (DTR activated). If you use the serial monitor the Arduino has enough time to boot and be ready to accept data from the PC. Your other program probably opens the serial interface (COM port in case you're using the commercial OS from Redmond) and immediately starts to send out data. The Arduino boot loader tries to interpret that as a new sketch but as it doesn't match the corresponding protocol it's discarded.

Hi Pylon,

Thanks for your reply. Both my boards actually have a CH340 chip onboard, so I'm using this as USB2Serial for both programming the device and serial communication.

I think you were right about the reset signal. I now use an external USB2serial converter and it works.

Thanks!