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
    July 30, 2019

    i happy that you went to great deal helping me...thank you. i have another doubt..i received extended CAN that has been sent by my CAN hardware PEAK CAN...i received using ID mask 0x70...it receives and blinks LED as indication...i need help separating that received data alone to a variable so that i can use in my functions...i need support on this ...i attach my main file...

    zambrano.luigi
    ST Employee
    July 30, 2019

    Hi,

    if you receive the correct CAN package with the expected ID, you should find the received data in crfp.data32[0] and crfp.data32[1].

    Best Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    July 30, 2019

    i got wrong values is it data type mismatch

    kjay
    kjayAuthor
    Associate III
    July 30, 2019

    posted a file.i send this via CAN

    kjay
    kjayAuthor
    Associate III
    July 30, 2019

    my program and datatype is uint32_t for recieving variable

    zambrano.luigi
    ST Employee
    July 30, 2019

    Hi,

    if I have understood, from the picture test2.jpg it seems that you are transmitting 00 00 00 44 - 55 66 77 88, and from the picture testcan1.jpg it seems that you are receiving 68d = 0x00000044 - 1432778632d = 0x55667788. So, it seems that the transmission works fine. What is the issue?

    Best Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    July 30, 2019

    ya i found now only its been in decimal ,i transmitted hexadecimal....ok thank you ...

    kjay
    kjayAuthor
    Associate III
    September 4, 2019

    hi zambrano.luigi,

    i need to configure another channel to produce same 20khz complementary pwm...that is 2 complemetary outputs, 4 pwm pins...i tried and first 2 only working ...what am i missing ...i tried configuring pwm1 also ..i couldnt find pins for that..help me i attach my application

    kjay
    kjayAuthor
    Associate III
    September 4, 2019
    zambrano.luigi
    ST Employee
    September 4, 2019

    Hi,

    you have to configure the output pins on which the new complementary PWM signals are output. For example, you can use the pin C[15] for the FlexPWM0 A1 and D[0] for the FlexPWM0 B1 (see A1_B1.jpg in attachment). In this way the new 2 complementary PWM signals will be output on the pin D9 and D10 of the connector X6 on the SPC56xL Discovery board.

    kjay
    kjayAuthor
    Associate III
    September 16, 2019

    cannot edit io setting on configuration.xml

    zambrano.luigi
    ST Employee
    September 4, 2019

    In attachment the modified version of your project.

    Regards,

    Luigi

    kjay
    kjayAuthor
    Associate III
    September 5, 2019

    thanks for the help...i already configured in pin map editor isnt that enough ...or i should configure in a way you stated...