Darrel's SPWM: Frequency, processor time..
Hi,
I am playing with SPWM and instant interupts. Great thing!! I am progressing slowly and have few questions. Is it possible to change SPWM frequency when code is running, like with SSPWM? Also, what is the best way to disable unused PWM channels to free some processing time? Is it enough to set duty cycle to 0?
Thanks,
Dan,
Re: Darrel's SPWM: Frequency, processor time..
Hi Dan,
Just bumping your thread because I'm keen to know the answers to your questions myself.
Especially regarding any workaround the issue of how to change the frequency on the fly.
I have been wondering whether the 'define' can reference an EEPROM address to this end ... but I don't know whether this is foolish ignorance on my part.
Regards,
T o n y
Re: Darrel's SPWM: Frequency, processor time..
Quote:
Originally Posted by
dran11
Is it possible to change SPWM frequency when code is running, like with SSPWM?
No, the frequency is calculated at Compile-Time by the assembler.
As is ... you cannot change the frequency at Run-Time, and all channels run at the same frequency.
Quote:
Also, what is the best way to disable unused PWM channels to free some processing time? Is it enough to set duty cycle to 0?
The number of channels are also fixed at Compile-Time.
It takes the same amount of processing when the dutycycle is 0 as it does at any other value.