Very cool clutchjunkie. Is that the Ti launchpad I see in the pic? Let us know how you like the little chips and the development environment.
I don't know how the arduino language goes about adjusting the timer prescaler on the AVR but by doing so you should be able to use the built in PWM functions at your 666hz if you wanted to. I personally would probably go about it just like you did for this application, but it is there if you want to play.
What does the arduino do when your pulse duraton is longer than your 1.5ms period? I'm not sure but I think you only have 5 steps of resolution before you run into this condition unless the 1500 is not a fixed period.
digitalWrite(Cfire, HIGH);
delayMicroseconds((VpowerLevel * 250)+400); //ON pulse
digitalWrite(Cfire, LOW);
delayMicroseconds(1500); //OFF pulse
}
EDIT:I see now that the off time is always 1500uS.
I don't know how the arduino language goes about adjusting the timer prescaler on the AVR but by doing so you should be able to use the built in PWM functions at your 666hz if you wanted to. I personally would probably go about it just like you did for this application, but it is there if you want to play.
What does the arduino do when your pulse duraton is longer than your 1.5ms period? I'm not sure but I think you only have 5 steps of resolution before you run into this condition unless the 1500 is not a fixed period.
digitalWrite(Cfire, HIGH);
delayMicroseconds((VpowerLevel * 250)+400); //ON pulse
digitalWrite(Cfire, LOW);
delayMicroseconds(1500); //OFF pulse
}
EDIT:I see now that the off time is always 1500uS.
Last edited:



