Don L. Jackson wrote: > > At 08:51 AM 2/9/97 -0500, you wrote: > >I hav been trying to get reliable serial communications on a 16C57 for > >a while now, an almost have it working. The problem is that it doesnt > >seem to get the first 3 bytes ok, they are always the same relative to > >the data but wrong. > > > >Here is what I should receive: > > > > 36h 32h 30h 32h 30h 38h > > The rest is ok. > > This is what I get: > > > > 4dh 4ch 4ch 99h 98h 38h > > > >Can someone tell me whats wrong? > > > >Data rate is 2400 baud, Total bessage is 32 bytes, I only need the first > >16. > > > >-- > >Alan Nickerson > > You may have a slight problem in timing, especially in processing each byte > after it is received -- appears you may be missing a start bit or something. > > If you write out the bit pattern of what the data should be, least > significant bit first from left to right on paper and insert a "10" between > the bytes for the stop/start bits, and then a similar bit pattern of what > data was received right below it, then you'll see that you are receiving > the data bits but out of frame sync. (Whew! what a sentence!) The > resultant data patterns will be skewed from each other. > > What algorithm are you using? > I am polling the receive pin 3 consecutive times, if each test shows the start bit then I call the receive buffer function. Here is a little more of the operation. The remote device sends an '>' (E3h) every 1.5 - 2 seconds. After that I can send a command. The receiving of the E3h works fine. After I receive the E3h and respond with my command, (in this case a request status). The remote system sends it's status message, however the first 3-5 bytes are mangled but the rest is fine. I cannot use an external clock to generate an interrrupt because the hardware design is already in use. I also cannot make any modifications to the current electronic design. A simmilar function is already in use with a different remote device, and this would be an upgrade to the newer remote unit. Thanks for your help. -- Alan Nickerson --------- It seems to me that the best new ideas come from people who don't know that they "can't". -- Paul Mathews, optoeng@WHIDBEY.COM