> I am sending 0x1F repeatedly and I have checked using a scope to see if
> the data I'm sending is being sent correctly which it is. However when I
> open a comms terminal on the PC side the data received will not always be correct.
If you open the comms program and THEN start sending the data, is it then OK?
If you are sending continuous asynchronous data and THEN open the comms program, how is the comms port meant to work out which bit in the data stream is the start bit? This is an ASYNCHRONOUS data transfer without any "framing patterns" of "flag bytes" (like hdlc and friends). There are only two things that determine which bit in the data stream is the start bit, and they are:
1 - The first bit after at least 10 bits of an idle line - of nothing being sent (with 8 bits, one start, one stop format).
2 - The receiver is properly synced up on the previous byte and has just seen its stop bit. The next low bit is the start bit of the next byte.
If you have to be able to start the serial comms while the embedded device is continuously transmitting, then have the latter add some gaps in transmission (of at least one whole byte time and preferably longer) every now and then. You should do this for robustmess even if you are synced up in case some noise on the line gets the receiver out of sync.
Tom