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.

TMDX654IDKEVM: ECAP APWM Duty Cycle

Part Number: TMDX654IDKEVM

Hello, 

I am using the PRU-ICSSG (250 MHz - 4ns) of the TMDX654IDKEVM in a current sensing application. I use the ECAP module in APWM Mode Operation to generate a 1MHz PWM with a 50% duty cycle. 

As 250*4ns= 1µs I’d expect the set the CAP1 = 250-1 = 249  and CAP2 = CAP1/2 -1 = 124. However this results leads to a Positive width of 504 ns and Neg width of 496 ns. Is it possible to get exactly 50% for 1 MHz? 

Regards,

Geoffrey

  • Hi Geoffrey,

    Which SDK version and example are you trying ?

    Regards

    Vineet

  • Hi Vineet, 

    As I was writing to reply I just detected a typo in my assembly code, the correct lines of codes are  : 

    zero &r0, 120

    SBCO &R0, ICSS_ECAP, ICSS_eCAP_ECCTL2_ECCTL1, 4
    SBCO &R0, ICSS_ECAP, ICSS_eCAP_CAP1, 4
    SBCO &R0, ICSS_ECAP, ICSS_eCAP_CAP2, 4

    SET R0, R0.t17
    SET R0, R0.t18
    SET R0, R0.t25

    SBCO &R0, ICSS_ECAP, ICSS_eCAP_ECCTL2_ECCTL1, 4

    LDI32 R0, 0X000000F9 ;249
    SBCO &R0, ICSS_ECAP, ICSS_eCAP_CAP1, 4

    LDI32 R0, 0X0000007D ;125
    SBCO &R0, ICSS_ECAP, ICSS_eCAP_CAP2, 4

    LBCO &R0, ICSS_ECAP, ICSS_eCAP_ECCTL2_ECCTL1, 4 
    SET R0, R0.t20 
    SBCO &R0, ICSS_ECAP, ICSS_eCAP_ECCTL2_ECCTL1, 4

    It actually works just fine now, thanks for your help ! 

    Geoffrey