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.

LP-MSPM0G3507: cross-triggering

Part Number: LP-MSPM0G3507

Tool/software:

Hey.

I am trying to understand the cross triggering, but I'm probably a bit daft, since I cant quite understand the datasheet and reference manual on the matter.
I have tried to set up two timers, where I want the up-counting compare event to cross trigger the second timer.
I know that two of the timers have a phase-shift capability, but I wonder if it would be possible to synchronize in this fasion?
The reason is, that I have a project where I need to generate four synchronized pwm's with the same period, but different (controllable) phase.

I have tried to set up a cross-trigger synchronization between TIMA0 and TIMA1, but I can' manage to get it to work.

I hope someone would give a "dumbed-down" walkthrough of how I would do this.

Regards

Anders

  • Hi, 

    The reason is, that I have a project where I need to generate four synchronized pwm's with the same period, but different (controllable) phase.

    Because one timer has only 2 event publisher channel and 1 cross trigger channel.

    We can not use one timer to generate 4 event to another four timer.

    You can use Timer A0 CC0/1/2/3's interrupt to start another 4 timer.

    Although there may be some errors in the software, the interrupt entry cycle is actually relatively stable. The only difference is that the interval between two CCs cannot be too short, because interrupt entry and exit takes time.

    Interrupt enter time is about 1.5us @ 32MHz. Entering interrupt takes about less that 40 CPU cycles.

    -------------

    Also, you can use 2 event publisher channel and 1 cross trigger channel to trigger 3 timers and use interrupt to start the 4th timer.

    I have tried to set up a cross-trigger synchronization between TIMA0 and TIMA1, but I can' manage to get it to work.

    If you want A0 fully control the start of A1, you should disable A1's repeat mode manually.

    Here is the reference config:

    Regards,

    Helic

  • thanks for your answer.
    I tried this:
    New project -> pwm0 using TIMA0.
    Busclk/8, prescale 40,  for 1000 period, 100Hz. Start timer checked.
    Edge-aligned up, pwm ch 3 (PA12), duty cycle 27.
    Main cross trigger, source: CCU 0 event

    pwm1 using TIMA1, same setup except:
    start timer not checked.
    pwm ch 0 (PA10)
    duty cycle 13
    cross trigger secondary, input trigger 0.

    When starting this, pwm0 goes from low to high, but then stays there, pwm1 stays low.
    I tried deleting pwm1 to what would happen - now pwm0 takes one whole correct period - goes up for 27% duty cycle, back down rest of period. Then it goes high again and stays there.

    I did try disabling repeat on pwm1:

        SYSCFG_DL_init();
       
        TIMA1->COUNTERREGS.CTRCTL = (TIMA1->COUNTERREGS.CTRCTL & ~GPTIMER_CTRCTL_REPEAT_MASK);


    But this made no difference.
    I'm afraid I dont understand what is going on - do you think you could explain what happens?

  • Hi, 

    Please pay attention this:

    We can not use one timer to generate 4 event to another four timer.

    And, here is a old version CCS project that using cross-trigger as your reference:

    timer_crosstrigger_G3507.zip

    Regards,

    Helic