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.

How to synchronize the PWM module of f28335 to a sine wave



Hi,

I'm working on an active rectifier. Which means that I need to, with the help of the PWM module in the f28335, switch the transistors on and off synchronized with the incoming sine wave to the active rectifier.

The sine wave will have an amplitude of roughly 90V and between 10kHz to 100kHz.

I basically have two ideas about how to do this. One way is to use the TB clock and phase direction of the PWM to find out what phase it has in relation to the sine wave (which can be measured using an ADC input) and then just setting the phase register of the PWM so they are synced.

The other way, which is probably faster, is to use the eCAP to determine frequency and sync the PWM to it. But I don't know whether the eCAP is able to detect rising/falling edge of the sine wave I'm measuring. Could anyone help me with this?

I'm scaling the sine wave down for the ADC/eCAP as follows:

100V sine wave = 2.5V to ADC/eCAP

0V sine wave = 1.636V to ADC/eCAP

-100V sine wave = 0.773V to ADC/eCAP

Does anyone here have any advice on the eCAP module's ability to measure rising and falling edge of the down-scaled sine wave? Or should I use the ADC?

//Christian

  • is it possible to change what the eCAP thinks is a "1" and a "0"? At what voltage level does it think there is a rising/falling edge by default? I can't seem to find this information in the datasheet.

  • The eCAP inputs will be qualified like any other digital pin, so you should look at the Vil/Vih specs in the datasheet. These are Vil = 0.8V and Vih = 2V, so I think you signal amplitude is (barely) enough to meet this.  You may have to weigh if this gives you enough noise margin.   

    A better solution would probably be to use an external comparator with your sine wave against 1.63V threshold.

    You could also use a TI device with integrated comparator-DAC (the F28377D device would probably be closest to F28335).