View Single Post
Old 25th Mar 2019, 8:11 pm   #13
Karen O
Rest in Peace
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 787
Default Re: Mk14 programming

UARTs are all much the same. They wait for a falling edge, wait half a bit time to see if the line is still low. If so it just samples the line on full bit time spacings to gather in the bits. It then times half way into the stop bit to ensure that it doesn't start looking for a new character too soon.

Some (like the PIC) sample three times at each bit centre and take a best of three determination of the bit state. Others just sample once. Regardless, a UART won't be upset by a state change mid-bit but there is uncertainty about what it will latch for that bit.

The upshot is, you'll probably have to tolerate a character of 0x00 OR 0x80 for a long pulse, and 0xff OR 0xfe for a short pulse (or something like that)

I think the Mk14 inter-pulse gap is adequate but set the serial port for one stop bit though.
Karen O is offline