jakezimmer
Member
Hello Everyone,
I was just wondering if there would be any way to use a command similar to Timer1.restart() or Timer3.restart() on the additional PWM pins on FTM0.
I only need one pin to output PWM at a time and therefore if this were not possible, would the best way to accomplish another "pin" on one of these timers be to use two transistors as a sort of branching path? For example, using the emitter of each as a pin and connecting the collectors together on pin 3 (or 4, 25, 32).
I have attached an basic circuit schematic below (I know it says Arduino but it gets the point across hopefully).
Thank you all for your help,
Jake
SOLUTION:
In case anyone else needs this functionality, you can use these functions directly inside the Arduino IDE to reset timer0.
I was just wondering if there would be any way to use a command similar to Timer1.restart() or Timer3.restart() on the additional PWM pins on FTM0.
I only need one pin to output PWM at a time and therefore if this were not possible, would the best way to accomplish another "pin" on one of these timers be to use two transistors as a sort of branching path? For example, using the emitter of each as a pin and connecting the collectors together on pin 3 (or 4, 25, 32).
I have attached an basic circuit schematic below (I know it says Arduino but it gets the point across hopefully).
Thank you all for your help,
Jake
SOLUTION:
In case anyone else needs this functionality, you can use these functions directly inside the Arduino IDE to reset timer0.
Code:
void stopT() {
FTM0_SC = FTM0_SC & (FTM_SC_TOIE | FTM_SC_CPWMS | FTM_SC_PS(7));
}
void resumeT() {
FTM0_SC = (FTM0_SC & (FTM_SC_TOIE | FTM_SC_PS(7))) | FTM_SC_CPWMS | FTM_SC_CLKS(1);
}
void startT() {
stopT();
FTM0_CNT = 0;
resumeT();
}
void restartT() {
startT();
}
Last edited: