The printer locked up

Hi all,
This just started happening recently, but I haven’t changed anything about my printer. So the other day I went to home my printer to start a print, and when it got to the x axis, the lcd started flashing (like it was shorting, not a controlled flash), and the printer locked up. Sometimes if you flip the power on and off it doesn’t even fix it right away, (but if you keep flipping it it will eventually turn on again. So my first idea was to disconnect the x stepper motor, which let the y and z axis home. So I tried plugging the y axis motor into the x axis controller to verify that it was the motor.
Everything worked fine. So I ordered the motor, but when I replaced the x axis motor, the printer still does the same thing! :imp: Does anyone have any idea what is causing this and what I can do to fix it? I am using the newest CURA and the newest firmware.
Thanks