Jan-Erik Soderholm wrote: >Laszlo Zsolt Nagy wrote : > > > >>I have a PIC18LF452, connected to my computer on the COM1 >>port (using a MAX232 to interface between the USART and the >>serial line). CLK = 32MHz, and I'm using 56700 bps speed. >>(Relative baud rate error is about 2%.) >> >> > >2 % is a *little* to much. Try to stay within +/- 1 %. > > It is not possible at 32MHz. I need speed both on the USART and in the PIC. I will try 40MHz, that will be 0.2% error. (Just I do not have a 40MHz crystal at hand.) >Does it work at a slower speed ? Like 9600 ? > > Good question. Trying... >>The simplest program I could create: read a byte from the >>USART port, add 16 and then write it back (in an infinite loop). >> >> > >That is *not* the "simplest program" you can create ! > >Start with only one direction. Send a hardcoded value >from the PIC to the PC and get that working first. > > Ok. Good idea. Thanks. :-) >>On the computer's side, there is a Windows application, >>sending out the byte '255' continuously. >> >> > >And what do you *expect* in return ? > > (255 + 16) mod 256 = 15 = 00000111b This is what I expect. Regarding the bit pattern, what I get is similar. Thanks, I'll try what you suggested. Les -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist