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.

CLA , set an output pin

Other Parts Discussed in Thread: CONTROLSUITE

Hello ,

I'm working on C28035 micro and I want to set / reset an output PWM pin with CLA (on C28035)

I just tryed this on cla.asm (modified existing control suite project) :

START:

    MEALLOW ; Allow CLA write access
    MMOVIZ MR0, #2.0
    MF32TOUI32 MR0, MR0
    MMOV16 @_EPwm1Regs.AQCSFRC.bit.CSFA, MR0 ;Set Half bridge1
    MMOV16 @_EPwm2Regs.AQCSFRC.bit.CSFA, MR0 ;Set Half bridge2
    MEDIS ; Disallow CLA write access

    MEALLOW ; Allow CLA write access
    MMOVIZ MR0, #1.0
    MF32TOUI32 MR0, MR0
    MMOV16 @_EPwm1Regs.AQCSFRC.bit.CSFA, MR0 ;Clear Half bridge1
    MMOV16 @_EPwm2Regs.AQCSFRC.bit.CSFA, MR0 ;Clear Half bridge2
    MEDIS ; Disallow CLA write access

    MNOP
    MNOP
    MNOP
    MBCNDD START,NEQ ;
    MNOP
    MNOP
    MNOP

but nothing happens on PWM pin...

Is there something else to add (include , config...) to work?

Thank you

Henri

  • Henri,

    I don't see anything wrong here, but I will say that I often find my CLA asm coding issues via debug as opposed to actually seeing them. :)

    What controlSUITE example project did you start with? 

    My first step would be to use MDEBUGSTOP to try to find out if your CLA task is occurring.  This should delineate coding/PWMconfiguration problems from CLAconfiguration/triggering problems.


    (I also wanted to let you know in case you did not know: there is a CLA C compiler so you can write your CLA code in C if you prefer.  ASM CLA programming can still be quicker if you know what you're doing, but the CLA C compiler works pretty well)


    Thank you,
    Brett