Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

OMAP L-138 LCDK using eCap modules with linux runing

$
0
0

Hi,

I need to use 4 PWM channels of the omap l-138 lcdk board, but i am only able to use 2 (ehrpwm.1:0 and  ehrpwm.1:1) of the 6 listed. Can you help me out understanding what i am doing wrong?

What i have under /sys/class/pwm/ :

root@omapl138-lcdk:/sys/class/pwm# ls                                           
ecap.1      ecap.2      ehrpwm.0:0  ehrpwm.0:1  ehrpwm.1:0  ehrpwm.1:1 

What i did to configure:

on board-omapl138-lcdk.c:

// Enable eHRPWM1A
#if 1
        if (1) {
            ret = davinci_cfg_reg_list(da850_ehrpwm1_pins);
            if (ret)
                pr_warning("###### da850_evm_init:"
                " eHRPWM module1 output A mux"
                " setup failed %d\n", ret);
            else
                mask = mask | BIT(2);
        }
#endif

// Enable eHRPWM1B
#if 1


        if(1) { 
            ret = davinci_cfg_reg(DA850_EHRPWM1_B);
            if (ret)
                pr_warning("######### da850_evm_init:"
                    " eHRPWM module1 outputB mux"
                    " setup failed %d\n", ret);
        else
            mask =  mask  | BIT(3);
        }
#endif

        //Enable PWM1A.
        da850_register_ehrpwm(mask);


mask = 0;

// Enable eHRPWM0A
#if 1
        if (1) {
            ret = davinci_cfg_reg_list(da850_ehrpwm0_pins);
            if (ret)
                pr_warning("###### da850_evm_init:"
                " eHRPWM module1 output A mux"
                " setup failed %d\n", ret);
            else
                mask = mask | BIT(0);
        }
#endif

// Enable eHRPWM0B
#if 1


        if(1) { 
            ret = davinci_cfg_reg(DA850_EHRPWM0_B);
            if (ret)
                pr_warning("######### da850_evm_init:"
                    " eHRPWM module1 outputB mux"
                    " setup failed %d\n", ret);
        else
            mask =  mask  | BIT(1);
        }
#endif

        //Enable PWM1A.
        da850_register_ehrpwm(mask);

//ecap modules
	da850_register_ecap(1);

	da850_register_ecap(2);

I found this link http://processors.wiki.ti.com/index.php/OMAP-L138_eCAP_Capture_Driver_User_Guide showing how to interact with the ecap modules on user space, but in my case i couldn't find the config file described. Also i tried to run it like a pwm module but no success.


An additional question:

What is the correct way to select the pins to use on the multiplexer? I am trying to use some GPIOs that i have configured on the da850.c file, but when i try to change its value nothing happen, the value remains always the same...

Thanks,

Pedro


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>