In an application I'm working on, I'm using serial communication on COM2, 9600-N81. If I build my application (using VS2008) and copy the executable to the PicoCom and run it, communication works as expected. I have a timer running (interval around 100 millisec) and every time the timer triggers I have around 10 bytes to process. But if I close the program and then run it again, SerialPort.BytesToRead returns 2047 every time regardless of what I do. I can read bytes, discard the buffer, disconnect the hardware sending the data: I keep getting 2047 bytes. Looks like the UART or the Windows serial driver has gone a bit wild.
Please note
1) I close the port on program exit
2) I discard any data in the input buffer when opening the port
3) I need to use a timer and not the Windows CE event driven model (the latter doesn't work well)
So, in short: comms work, I close program and run it again, comms doesn't work
What could possibly be wrong?