Thanks for the feedback so far. And for pointing out the errors in my program... yes, I changed the spec and turned CR into LF in the code, and also as I was copying and pasting my example from a larger program, I didn't notice the missing
lines of code. As for the buffer running over, my program will only see 52 characters between LFs, so even a garbled one will get cleaned up in the next turn. [I could fix this, but only have six bytes free in the Leonardo's memory after compile.]
However, I'm still stuck with the repeated character issue, so I'll try the AltSoftSerial alternative and report if it works. It's worth pointing out that I've been experiencing this problem even when typing one letter at a time on a terminal, at 2400 baud with long gaps in between each input character, so it's not as if the SoftwareSerial routine is being slammed with data faster than it should be able to handle...
My full program contains the following headers
and its purpose is to take incoming data from the SoftwareSerial port from an industrial machine, and format it for output to a POS printer on TX pin 1, with various formatting and paper cut commands. Unfortunately, I can't use the RX pin 0, as this is a PC terminal interface for changing parameters, and I can't use the USB serial port, since there will be no PC attached to this project. That's why I needed to use SoftwareSerial in the first place.
Somewhere, I have an Uno board and a Freeduino Duemilanove, and I'll dig them out tomorrow and try the same code on this, to see if the SoftwareSerial library struggles here, too.
So, I was really wondering whether there is a known fault in the SoftwareSerial library, and if so, if there were alternatives. So, I'm particularly interested in the AltSoftSerial library, and will give this a try tomorrow too.