Skip to main content
kjay
Associate III
July 1, 2019
Solved

how to configure flex pwm to give complementary pwm of 20 khz.

  • July 1, 2019
  • 59 replies
  • 27260 views

.i need help with calculating clock and time peroid and waht is other pwm pin if pwm0 has d10 which is complemetary pin in spc56el70l5-disp

    This topic has been closed for replies.
    Best answer by zambrano.luigi

    Hi,

    as already explained, when the synchronization is enabled, all the submodules are managed as a unique driver with 8 channels (ch0 = A0, ch1 = B0, ch2 = A1, ch3 = B1, ch4 = A2, ch5 = B2, ch6 = A3, ch7 = B3). So, if you want to enable the outputs A1 and B1, you have to activate in the PWM configuration the channels 2 and 3 (see Sync_Conf.JPG in attachment). In attachment you can find the modified version of your project in which I have enabled the channels A0, B0, A1 and B1 (in particular, I have configured B0 as the complementary of A0 and B1 as the complementary of A1). In the picture Sync_PWM_Waveforms.JPG you can see the output waveforms.

    Best Regards,

    Luigi

    59 replies

    kjay
    kjayAuthor
    Associate III
    November 13, 2019

    hi ,

    can you please give an example for clock settings to run spc56el60l5 at 120 MHz in dual lockstep mode. thank you.

    kjay
    kjayAuthor
    Associate III
    November 14, 2019

    synchronized pwm is not working for me can you check what mistake...i did as you told .. A0 AND B0 COMPLEMENTARY WORKING ...A1 AND B1 IS NOT WORKING NO OP FROM F0 AND D14please help.

    zambrano.luigi
    zambrano.luigiBest answer
    ST Employee
    November 14, 2019

    Hi,

    as already explained, when the synchronization is enabled, all the submodules are managed as a unique driver with 8 channels (ch0 = A0, ch1 = B0, ch2 = A1, ch3 = B1, ch4 = A2, ch5 = B2, ch6 = A3, ch7 = B3). So, if you want to enable the outputs A1 and B1, you have to activate in the PWM configuration the channels 2 and 3 (see Sync_Conf.JPG in attachment). In attachment you can find the modified version of your project in which I have enabled the channels A0, B0, A1 and B1 (in particular, I have configured B0 as the complementary of A0 and B1 as the complementary of A1). In the picture Sync_PWM_Waveforms.JPG you can see the output waveforms.

    Best Regards,

    Luigi

    zambrano.luigi
    ST Employee
    November 14, 2019

    Hi,

    the SPC56EL for default works in Lockstep Mode. unless in case of you have enable the Decoupled Parallel Mode. This means that all the examples in SPC5Studio are executed in Lockstep Mode. The unique example executed in Decoupled Parallel Mode is the SPC56ELxx_RLA DualCore Test Application for DiscoveryPlus, but, in order to execute it the Decoupled Parallel Mode must be enabled as explained on the reference manual.

    Best Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    November 14, 2019

    you saved me...you are the best....THANK YOU SO MUCH FOR THE HELP....I NEED CLOCK CONFIGURATION MAXIMUM WORKING frequency..120Mhz.how to set in clock tree i need example and explanation ...please guide me or send me material and example... i need to understand lockstep and decoupled mode and what it is used for?? i need to learn about that too...thank you.

    zambrano.luigi
    ST Employee
    November 14, 2019

    Hi,

    in the last application that you shared with me the System Clock is already set to 120MHz, has you can see from the picture in attachment.

    Best Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    November 14, 2019

    i see that but need to know how setting works ..to modify for my application..i need material for reference explaining configuration ...for bot modes also...in spc5studio.

    zambrano.luigi
    ST Employee
    November 14, 2019

    Hi,

    the clock component within SPC5Studio matches exactly the clocktree that you can find on the Reference Manual in terms of PLL parameters, clock dividers and selectors. In particular, if you click on the Clock tree button (see attachment), you can also opened a graphic view of the clocktree that matches exactly the picture on the Reference Manual and allows you to make all the desired configuration .

    Best Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    November 19, 2019

    i have came across another problem..i communicated flexcan0 and flexcan1...using CAN1 and CAN2 drivers...while sending same configuration CAN2 is not sending anything...if i disable CAN1 it is working...i need to know both CANs working simultaneously on the same configuration same data...please help..i attach my code. what am i doing wrong..

    kjay
    kjayAuthor
    Associate III
    November 21, 2019

    please help with this

    kjay
    kjayAuthor
    Associate III
    November 21, 2019

    hi,

    i need to know how to use DMA for ADC and SPI and CAN Communications...please help me...provide me example for accessing DMAs ..in stm32 we can use Circular conversion in case of ADC...i dont know how to properly configure please help...i am on edge...

    zambrano.luigi
    ST Employee
    November 21, 2019

    Hi,

    within SPC5Studio you can find the DMA support to the drivers ADC, SPI and LinFlex. Moreover, you can find a lot of examples that show how to use the different supported drivers. Obviously, it is not possible to coverage all the possible usage cases. For more details, please, refer to the Reference Manual.

    Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    November 21, 2019

    actually i agree with you....i cant find example of using DMA...please provide one example for accessing 2 channels of ADC0 or ADC1 via DMA...like we do in stm32..