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.

Interruprt priority and PWM sync

I am using 28335 . and have two differenct cards , both the have same DSC.Now i want to make the PWM triangle of both the card same .. so is there any way for doing this?

both the cards are almost 10 ft apart from each other.

and want to make the can interrupt higher priority over CPU timer interrupt. what should i do for this?

the can interrupt must be serviced while CPU or any other interrupt is being serviced.

 

  • Rathod,

    On making the PWMs the "same", are you talking about having both devices use the same PWM settings?  Or are you talking about creating PWM synchronization between the two chips?

    For more on Multiple interrupts I would refer to the following link:
    http://processors.wiki.ti.com/index.php/Interrupt_Nesting_on_C28x
    http://processors.wiki.ti.com/index.php/Interrupt_FAQ_for_C2000



    Thank you,
    Brett

  • yes i want to make synchronization between two DSC PWM triangle, mean they both should same direction and count..

    how to do it?

  • Rathod,

    There are a few potential methods I can think of. 

    1) Use the PWMSYNCI and PWMSYNCO features.  Define one PWM generator as the "master" and have it output a PWMSYNCO signal and then tie this signal to the EPWMSYNCI of the "slave" PWM generator. Depending on your application, you may want the PWMs to continually synch or you may want to have the master disable its SYNCO after the first synchronization pulse is generated. 

    2) Use unused GPIOs to trigger an external interrupt (XINT) and, in the XINT interrupt, synchronize the timers at a known TBCLK.

    However, because of the distances between devices things may be tricky.  No matter how you end up doing the synchronization, I think you'll need to test this pretty well and come to an exact definition of how synchronized you need the two to be.

    Perhaps someone else will have some ideas as well.

    Good luck on your project!


    Thank you,
    Brett

  • Actually  the problem is distance,, and the SYNCO signal has max width is 8 cycle mean only 48ns Pos width,, so it is difficult to send.. but suppose if i use one PWM  to connect the  SYNCI pin of other DSC,, then what can be max width for SYNCI signal?

  • Rathod,

    I'm unsure, but I believe the key thing is the L-to-H transition not necessarily the width of the pulse. 

    I believe this is where experimentation will come in, but I'd try to use the SYNCO output first before trying to make a PWM-simulated SYNCO pulse.

    Out of curiosity, how close are you wanting to synchronize the PWMs?


    Thank you,
    Brett

  • I have follow below way..

    I have generate 6.4Khz PWM in one card and then I have connect that PWM to the SYNCI pin of THe another card,, and congigure like below

     

    EPwm1Regs.TBPHS = 0; // Set Phase register to zero

    EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical mode

    EPwm1Regs.TBCTL.bit.PHSEN = TB_ENABLE; // Master module

    EPwm2Regs.TBCTL.bit.PHSDIR = TB_UP; // Count Up on sync (from zero)

    EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW;

    EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; // Sync from SYNC IN pin

    EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;

    EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;

    EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; // load on CTR=Zero

    EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; // load on CTR=Zero

    EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // set actions for EPWM1A

    EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;

    EPwm1Regs.AQCTLB.bit.CBU = AQ_SET; // set actions for EPWM1B

    EPwm1Regs.AQCTLB.bit.CBD = AQ_CLEAR;

     

     

     

    and I have used GPIO32 as sync In pis..

    I have configured GPIO32 as input and in MUX register value is 2 mean work as sync in..

     

    I am getting the 6.4Khz signal from other card on SYNCI pin ,, but i am not getting the effect,,mean the both the card counter value is not being same..

    what to do ?..

     

  • Rathod,

    Note that your PHSDIR set instruction is for Pwm2 instead of Pwm1.  However, I don't think this will be your root problem.

    Other than that, with a quick look I don't see an issue with your configuration.  I would recommend checking that you're EALLOW & EDIS for the GPIO configuration. 

    I would also recommend trying to do a forced software SYNC (in the TBCTL register).  This latter should allow you to know whether the issue is with your PWM configuration or with the PWMSYNCI signal.


    Thank you,
    Brett