I have an arduino and a citizien cb 231 thermo printer driven over an max233 and its serial interface. I double checked every connection and everythingss works great, just the @ char and the space is not working probably. Sometimes it prints the correct character, othertimes it mixes up the spaces between words.
E.g.: this is a0test
Or: hello world8this is0a test
You see the 0s and the 8.
Does anyone have an idea where the problem could be?
Ok.. more information coming. I was on a train this morning and only had my mobile, so I thought I just give it a try.
Are there any electrically noisy devices between? (flourescent lights, motors, Van de Graaff generators)
I don't know. My notebook, a desk lamp, my tft monitor are near by. The cables are pretty short.
Parity?
Baud rate mismatch?
Wrong number of start/stop bits?
My baud rate is 9600, this should be correct. The printer itself says that it uses 9600.
What is parity?
I think, I actually don't use start and stop bits. I tried that, but it ends up in weird printings.
If you're mixing soft and hard serial, I'd put delays after the hard serial calls proportional to one character period (at least 1ms at 9600 baud) to ensure the last character has gone out before you do anything else.
I actually don't use start and stop bits
The default is usually one start, one stop. Check what the printer requires - it may need two stop bits.