Using an Uno r4 Minima, I got a BLDC to spin with an ESC by switching the signal pin from D7 (non-PWM) to D9 which is PWM-enabled. I don't understand why this worked.
I wrote my own 50Hz PWM sketch using digitalWrites HIGH and LOW and never using analogWrite. When I use a pin purely digitally, I prefer a non-PWM pin to leave room for things that might need it.
When using pin 7, I got a 180-degree servo and a continous servo to work as expected, but it would not work with an ESC. I used the Servo code and switched the pin to 9 and the ESC worked.
I then switched my pin in my sketch to 9 and it worked.
If all I am sending to the ESC is LOW or HIGH, why does it need to be connected to a PWM pin?
That was the question. I boiled it down to the relevant issue -- with a non-PWM pin, fail; with PWM pin, success. I made absolutely no other changes to the circuit or the code.
I was hoping that someone with knowledge and/or experience with ESCs could explain why a device that expects a digital signal of 50Hz needs to be connected to an Arduino PWM pin which runs at a much higher frequency.
Servos and ESCs do not have to be connected to a PWM pin. Did you try it with the Arduino Servo library? Did you "arm" the ESC? Which ESC? Post link to datasheet or brand name and EXACT part number or seller's web page.
Servos and ESCs do not have to be connected to a PWM pin. I thought so, too. I was looking for insight on why this appears to not be true.
Did you try it with the Arduino Servo library? Yes, it worked with the code as written. For my homemade PWM, it did not work when SERVO was pin 7, but did work when it was on pin 9. (Uno r4 Minima)
Did you "arm" the ESC? Yes
Which ESC? Post link to datasheet or brand name and EXACT part number or seller's web page. It is one of these. 30A_BLDC_ESC_Product_Manual.pdf (172.0 KB)