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.

Problem with DPlib PWMDRV_PSFB macro

Hi,

I have used DPlib few times. I am using F28069 controller card. But PWMDRV_PSFB macro does not work. My souse code has attached below.

For a example if I use  PWMDRV_PSFB_VMC_SR macro when MY_BUILD == 2 , the programme works. But It is not working for  PWMDRV_PSFB when MY_BUILD == 1. Please help me to fix this problem.

project files.rar

  • Shiaranga,

    Clean up your assembly file you have conflicting build settings

    for examples in DPL_ISR if MY_BUILD ==1 and INCR_BUILD==1 there will be conflict.. 

    same is valid for the init routine

    ;---------------------------------------------------------
    .if(INCR_BUILD = 1)
    PWMDRV_1ch 2 ; PWM2A
    .endif

    .if(MY_BUILD = 2)
    PWMDRV_PSFB_VMC_SR 1,2,4

    .endif

    .if(MY_BUILD = 1)
    PWMDRV_PSFB 1,2
    .endif

    .if(MY_BUILD = 3)
    PWMDRV_PSFB_NEW 1,2

    .endif

  • You are correct. But I have not make them conflict. I make active one building option for one time. When I build with MY_BUILD ==1, other building options set to zero. further all the building options were compiled without showing error. But only PWMDRV_PSFB macro build does not work. PWMDRV_PSFB_VMC_SR is working. Is there a any problem with PWMDRV_PSFB .asm file. Still could not fix that.
  • Shiranga,

    Ok I see the issue.. go to the macro and replace the following section with the code below, let me know if this fixes the issue

    QMPYL ACC,XT,*XAR0 ; ACC= (I8Q24) * (I16Q0) = (I24Q24): upper 32-bits -> P = (I24Q8)
    LSL ACC,#7 ; ACC>>8 = I32Q0
    MOV @_EPwm:m:Regs.TBPHS.half.TBPHS,AH