I was trying to make a brushed esc for my 720 coreless motor to be used with fs2a receiver from flysky. I had a SL3416 (n channel 6A mosfet), 10k resistor between gate and source, SS24 diode between motor terminals, 10uf+15nf caps across attiny824 vcc and gnd.
However, by mistake I had put a p channel si2301 mosfet in place of SL3416 and tried using it (didnt realize that it was a p mosfet). Since the motor didnt rotate (obv), I realized my mistake and replaced it with the SL3416. This is where I ran into a problem.
With the motor disconnected, the values I get range from 1.5V-3.9V (I was using 1S 550mah 90C HV lipo, charged to 3.9V) and when I put a lighter load (615 coreless motor with 45mm prop, 0.7A continous, 1.5A stall) then the range becomes 0-3V. With the 720 motor, it falls to 0-0.4V.
After probing with the multimeter a bit, I found that the attiny’s pwm pin was the culprit itself. Instead of the full 0-3.9V, it changed with the load.
Why is this happening? If the pin was damaged, shouldnt it not work regardless of the load? I am only using it to drive a mosfet, not the motor itself.
Is there any way I can still use the attiny? Or would I have to bin it?
I tried using a 1k resistor in between Gate and PA5 of the attiny, but nothing changed. I also tried changing the pin from PA5 to PA4, but the result was the same.
As for the code, here it is
// ATtiny824 basic RC-to-PWM test
// PB0 = FS2A receiver throttle input
// PA5 = MOSFET gate PWM output
const uint8_t IN_PIN = PIN_PB0;
const uint8_t OUT_PIN = PIN_PA4;
void setup() {
pinMode(IN_PIN, INPUT_PULLUP);
pinMode(OUT_PIN, OUTPUT);
analogWrite(OUT_PIN, 0);
}
void loop() {
unsigned long pulse = pulseIn(IN_PIN, HIGH, 30000);
if (pulse >= 1000 && pulse <= 2000) {
uint8_t pwm = map(pulse, 1000, 2000, 0, 255);
analogWrite(OUT_PIN, pwm);
} else {
analogWrite(OUT_PIN, 0);
}
}
Any help would be appreciated ![]()

