While my send UART code has been pretty solid for some time, I’ve always though my receive uart code needed doublechecked and worked on.
I spent some time today just going through the code, graphing out some timing diagrams, checking my cycle-counts and so forth. The RX uart code is actually pretty good. There is some minor jitter in detecting when the startbit actually falls, but it is on the order of a couple cycles. Depending on exactly when the start bit happens, it can either take 2 cycles or 4 cycles. This is only a difference 40ns, and I’m not horribly worried about it.
I still want to do some type of stress test on it because I don’t want this to be a source of problems if I ever decide to implement writing as a feature.