I am sending data from an Arduino Uno to an Arduino Mega via serial communication.
The data is analog value. I'm getting that data and converting it to an int. There is no problem there. However, when I connect the servo to the attached pin, the serial communication on mega becomes disconnected. When I remove the PWM pin, the serial communication is working again. Why does the servo stop serial communication?
Wiring: Mega-- 5v and gnd pins linked to servo ( 13kg/cm ), PWM 2 pin is linked to servo's pwm input, rx2 pin is linked to uno's tx pin