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.

PMP23126: Ramp Generator SYNCPER Value

Part Number: PMP23126
Other Parts Discussed in Thread: PMP23216

Hi,

I'm trying to investigate PMP23126 software. I'm also trying to implement peak current mode control.

1) RAMPMAXREF is the maximum reference value for ramp generator. It is value is decreased at each system clock. However, rampgenerator clock should be synchoronized to ePWM timebase to obtain proper operation.

I read that SYNCO isn't SYNCPER. Therefore, I need to write to my code HRPCTL register. e.g. ePWM1 will be sync to Rampgenerator. SYNCPER signal will be routed to ramp module at every TBCTR=ZERO.

I think proper peak current mode control will be handled like that. When I investigated the code I just saw following line.

    EALLOW;

    //
    // Set PWMSYNC as coming from ADC_OVERSAMPLE_PWM_BASE
    //

    HWREGH(PSFB_PCMC_OCP_CMPSS_BASE + CMPSS_O_COMPDACCTL) =
            (HWREGH(PSFB_PCMC_OCP_CMPSS_BASE + CMPSS_O_COMPDACCTL) &
             ~(CMPSS_COMPDACCTL_RAMPSOURCE_M)) | (8);

    //

    EDIS;

My code is driverlib based, and there is no function to implement SYNCPER signal to ramp generator. Did you do it because there is no driverlib function?

Could you please confirm me?

2) It is hard to under what is happening in above line? Is there any easy way to understand such HWREG functions?

3) What is the meaning of 8 at those line? Does 8 mean epwm8? Is it synchoronized to epmw8?

4) I couldn't see adc oversampling line. Could you please provide code snippets from PMP23216 project?

5) I want to get my EPWM1 to sync to ramp generator. What should I write to my code?

Thanks in advance.