By default, PIC ports have their OFF or IDLE condition as zero volts. RS-232 however defines the IDLE or steady mark to be negative volts at the 25 pin connector. This means the idle condition between the PIC and the MAX232 chip must be HIGH or positive - the reverse of what you might first think.
An asynchronous character begins when the receiving device detects the transition from the steady MARK to a SPACE bit. BUT, if you did nothing to the Txoutput pin before that character started, then the line had been in the space condition for some time. i.e. the start bit goes missing and so the character is corrupted.
Try this.
HIGH Txpin 'sets the RS-232 connector pin to negative = Mark = Idle
pause 1 ' lest the line settle and the remote device see the mark condition
Serout/hserout/serout21 pin, rate, data 'the message now starts with a guaranteed start bit.
HTH
BrianT
Bookmarks