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.

Linux/AM5728: AM57xx-EVM PWM dead-band feature

Part Number: AM5728

Tool/software: Linux

Am able to generate PWM waveform  on two channels. Now i want to enable dead-band feature. As current driver having no support of dead-band configuration. So am using mmap to configure dead-band from user space C application using code composer but not able to generate dead band. Is there any way how to achieve this. 

What the possible way in TI-LINUX-SDK for AM572x-evm to generate dead band.  

  • Hello Akash,

    Technically this is a non-supported feature in TI Linux. Let me poke around to see if I can find anything that would be helpful.

    Please post your version of software, and your code trying to generate dead-band. We don't support application development in the forums, so I might not be able to give feedback - but it might also help me in helping you.

    Regards,

    Nick

  • Hi Nick,
    Am not asking about application support, am just want to know approach to use dead-band feature of PWM controller. I tried from driver side but not succeed, then i using user space by using mmap and right now am struggling with it.

    Am using Code Composer Studio - Version: 8.2.0.00007
    ti-processor-sdk-linux-am57xx-evm-05.01.00.11

    Sample Code

    void* DBCTL_addr = NULL;

    int fd = open("/dev/mem", O_RDWR);
    if( fd < 0 )
    {
    printf("Could not open memory\n");
    return;
    }

    DBCTL_addr = mmap(NULL, 0x00000200, PROT_READ | PROT_WRITE, MAP_SHARED, fd,(baseAddr));

    volatile unsigned* DBCTL_Ouput = (unsigned*)(DBCTL_addr + EHRPWM_DBCTL);
    *DBCTL_Ouput = 0x0000221F;
    /* (DBCTL_addr & (~EHRPWM_DBCTL_OUT_MODE)) | ((DBgenOpMode << EHRPWM_DBCTL_OUT_MODE_SHIFT) &
    EHRPWM_DBCTL_OUT_MODE); */
    close(fd);

    Take help from below mention link used for am335x
    android.googlesource.com/.../ehrpwm.c
  • Hello Akash,

    I do not see any TI Linux guidance on using the dead band functionality, but it looks like TI RTOS does have tools for using it. Take a look at the RTOS SDK (I downloaded only pdk_am57xx_...). In particular, I think pdk.../packages/ti/csl/src/ip/epwm should have useful information for you in csl_epwm.c and csl_epwm.h

    Regards,
    Nick