Hello. I'm a student working on a project which uses Arduino. Me and my project mates were trying to run a brushless motor using an Arduino Uno. We already succeed running the motor with an ESC. After that, we tried running the motor using a MOSFET driver circuit. We came across some websites that makes use of the PWM frequency to run the motor. So we tried changing the PWM frequency using these codes:
TCCR1B = TCCR1B & B11111000 | B00000001; // set timer 1 divisor to 1 for PWM frequency of 31372.55 Hz
TCCR2B = TCCR2B & B11111000 | B00000001; // set timer 2 divisor to 1 for PWM frequency of 31372.55 Hz
Code reference: https://arduino-info.wikispaces.com/Arduino-PWM-Frequency
We failed to run the motor with the MOSFET driver. Now, we have a problem with the Arduino. After messing around with the timers, we could not run the motor with our ESC (which we previously could). I tried uploading a simple PWM sketch that uses potentiometer to fade or dim the LED. However, the LED did not dim properly. The brightness changed only a bit. From here, I conclude that our MOSFET driver circuit was not the problem.
Another thing I noticed was, the ATmega328 IC heats up easily even though I uploaded a simple sketch.
I also read from this link (Arduino Playground - PwmFrequency) that changing the PWM frequency could disrupt normal operations of many functions. That's where I conclude that changing the PWM frequency was the root of the problem.
I'm hoping that anyone who is familiar with this situation can share their solution or opinions here. I would appreciate it so much.
Thank you for your time, have a nice day ahead.