The problem I was having was that I neglected to divide my crystal speed by 4 when determining the value to put in SPBRG for my desired baud rate. Having used 5MHz instead of 20MHz in my calculations, I now have exactly HALF of the characters working (!!!) Why? The distinguishing factor between those that work and those that don't is in bit 3. All characters of the form xxxx 1xxx work, but all characters of the form xxxx 0xxx do not. Specifically, all the characters that do not work are causing a framing error. Can bit 3 have an effect on the stop bit? Very strange, Paul ----- Original Message ----- From: "Paul Fleetwood" To: Sent: Sunday, July 08, 2001 2:09 PM Subject: [PIC]:17c44 usart timing problem I am trying to get a PIC17c44 to echo characters to a PC through a serial port. I *have* confirmed that the hardware around the pic is working properly. I have noticed that when a character is typed in hyperterminal, the pic seems to receive only every other bit of the data, and then pads the remaining four bits (using 8 data bit, asynch mode) with 1's. I suspect this is caused by the pic checking the values on the RX line too infrequently and then picking up stop bits (high) and filling the remaining 4 bits with '1's. I am using d'32' in the spbrg and am able to send and receive characters to and from the pic, just not what I should be getting. Example #1: type 'a' 0x61 b'0110 0001' in hyperterm recv 0xF4 in pic (output to a port) b'11110100' (the low nibble of this byte is everyother bit of the 'a'. "echo" to PC PC recvs '0' 0x30 -- don't know what is happening here. (Example 1 occurs for all characters which have 0100 = to every other bit) Example #2 type 'b' 0x62 b'0110 0010' recv 0xF5 in pic '1111 0101' (low nibble is every other bit of 'b') echo to PC PC recvs '6' 0x36 -- don't know what is happening here. (Example #2 happens for all characters which have 0101 = to every other bit) Is there some way to change the RCREG sampling timing, or am I on a wild goose chase? Any help would be greatly appreciated, Thanks, Paul -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body