Hi, i'm trying to modify pwm frequency to fit to my DC motor, i think i would need at least 20khz, the problem seems that i'm not good at it :D
i'm testing this code :
//First clear all three prescaler bits: int prescalerVal = 0x07; //create a variable called prescalerVal and set it equal to the binary number "00000111" TCCR0B &= ~prescalerVal; //AND the value in TCCR0B with binary number "11111000" //Now set the appropriate prescaler bits: int prescalerVal = 1; //set prescalerVal equal to binary number "00000001" TCCR0B |= prescalerVal; //OR the value in TCCR0B with binary number "00000001"
this should bring my pin 5 and 6 to 64khz ... but no luck, my motor seems to still have problem, when i increase the duty cycle it spins , not at full power, and in 30sec it stops.
(i'm driving it with an SN754410NE, wich i used with some other smaller dc without any problem)
when i connect the motor to the +5V from my generator it spins like hell ...
its so frustrating ... :-/