Odd problem - possibly a voltage issue...

Hi all.

I have an arduino hooked up to an LCD display, a PS2 keyboard, and a serial label printer via MAX232.

I am powering the Arduino from an external 9v power adaptor, and the printer is also running from its own mains cable.

The LCD prompts the user to type their name, which appears on the LCD as they type, then when enter is pressed, it sends the neccessary code to the printer to print the name.

All this works fine - the first time!

When first powered up (or reset is pressed) the keyboard entry works fine and when enter is pressed, the printer outputs the way it is supposed to, but after that - as the LCD is again prompting for a name entry, the keyboard characters are all gibberish, and I have to press reset to get it to work correctly again.

I have the keyboard hooked up as per the instructions on the PS2Keyboard page, and the printer has two pins connected, GND and Tx to the arduino (via MAX), nothing else is connected.

Could this be something to do with the voltage pulled from the arduino as the printer starts working?

Not sure what I can do, i'm new to both electronics and programming, and am proud of how far i've got, but this is driving me crazy, I don't want to have to press reset everytime something has been printed.

Anyone got an idea why this should be happening?

Thanks in advance and best regards.

Not got a definitive answer but it could be one of two things:-
Software - something in he loop is screwing up. Try to use the monitor to simulate what the printer sends.

Decoupling - The act of the label maker's motor coming on is crashing the Arduino due to noise being coupled into the supply. Is it possible to disconnect the motor bit and have it just work with the display. That way you can see if it is the motor or the software. The solution would be to add decoupling capacitors and or inductors to the supply of all devices. De-coupling

Thanks I'll have a read of that link.

If I disconnect the printer from the Arduino completely, the program loop runs fine everytime, even though it thinks it's sending the data to the printer. So it doesn't appear to be software related - it just seems to go wrong when the printer actually does something!

Regards