This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ePWM timer comparison

Dear All,

I'm facing a problem with F2809. It is necessary to access the ePWM modules for time based interrupt generation using counter-compare registers CMPA CMPB. A total of nine comparison events are needed for a multi-phase machine. The current application is not traditional PWM, the ePWM outputs are simply configured as generic GPIO output pins via GPIOMUX, therefore they cannot be controlled by the action qualifier as EPWMA EPWMB any more, however they still must be set/cleared with respect to timer comparison that runs in the background, i.e. single pulse operation. Those output pins and the timer itself are independent but it is not clear to me if such an application is possible even after reading the reference manual(s) carefully. Perhaps the shadow registers could be used in a different way to accomplish this?

Any suggestions are greatly appreciated, many thanks in advance,

MC

  • I don't think it is possible in hardware ... if you want to manage IO outputs based on timer compare results then you will most likely have to generate interrupts at each event to set/reset your IOs according to your algorithm .. this will obviously introduce interrupt delays and the assumption is your application will be okay with that delay.

  • Hello Arefeen, thank you for answering. Some minor delay could be acceptable, however i couldn't figure out how to control the internal interrupts that are based on ePWM timers and assign them to i/o pins, whilst the action qualifier submodule is not used. It should have something to do with manipulating the shadow registers but still can't find my way. Any clues please? Thanks again.

  • IO loadings can't be shadow enabled .. if you are not operating in PWM mode then all those features go away - at least that is my understanding. In your isr you will simply have to set/reset particular IO based on your algorithm and the IO state will change after writes, no shadow feature. If you need shadow feature then look for ways to use PWM outputs ... ePWM modules are very flexible and may be there are ways to generate your desired waveforms using ePWM blocks.