Microcontrollers reset problems are created when you are using same power supply for driving the microcontroller and the motor. If your board is not behaving as expected then there is a way to find out ,
Read this post on raviyp.in