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.

OMAP-3730 kernel development

Other Parts Discussed in Thread: TPS65950

Hi

I am using tdm3730 module for my project .. I need omap-dmtimer documentation  for my study purpose.

In Omap 3730 , I want  to implement variable dutycycle from 0 to 100%  for  10ms  in pwm kernel driver.. Any one help me to finish it off.. 

  • Moving this to the DM37X forum.
  • Hi Rajalakshmi,

    The integrated power management module is responsible for the pwm. Therefore you need to send a command to the power management circuit of your board to start sending PWM signal with desired duty cycle. There is an example which makes this with TWL4030 power management circuit:
    /*
    * PWMA/B register offsets (TWL4030_MODULE_PWMA)
    */
    #define TWL_LED_EN 0x0
    #define TWL_LED_PWMON 0x0
    #define TWL_LED_PWMOFF 0x1

    static void omap3evm_set_bl_intensity(int intensity)
    {
    unsigned char c;

    if (intensity > 100)
    return;
    /*
    * Enable LEDA for backlight
    */
    twl_i2c_write_u8(TWL4030_MODULE_LED, 0x11, TWL_LED_EN);

    if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) {
    c = ((125 * (100 - intensity)) / 100) + 1;
    twl_i2c_write_u8(TWL4030_MODULE_PWMA, 0x7F,
    TWL_LED_PWMOFF);
    twl_i2c_write_u8(TWL4030_MODULE_PWMA, c,
    TWL_LED_PWMON);
    } else {
    c = ((125 * (100 - intensity)) / 100) + 2;
    twl_i2c_write_u8(TWL4030_MODULE_PWMA, 0x1,
    TWL_LED_PWMON);
    twl_i2c_write_u8(TWL4030_MODULE_PWMA, c,
    TWL_LED_PWMOFF);
    }
    }

    from kernel/arch/arm/mach-omap2/board-omap3evm.c file.

    BR
    Tsvetolin Shulev
  • Hi Shulev ,
    Thanks for your mail. But i want to vary the period and frequent dutycycle variation like 5%, 10% ,25% to generate spwm .Will you help me how to write kernel code or user space code.
    I tried with With this below pwm driver but i cant see any dutycycle variation in scope.
    sweet.io/.../omap3-pwm
  • Rajalakshmi,

    If you wish to check the PWM parameters (duty cycle and frequency) with software method you should read the corresponding register of the power management circuit using the int twl_i2c_read_u8(module, &check, address) function.
    I suggest you to read section 8.4 LED Driver and PWM Generators Functional Description from the TPS65950 OMAP(TM) Power Management and System Companion Device ES 1.2 TRM guide at:
    www.ti.com/.../technicaldocuments
    for understanding the PWM mechanism.

    BR
    Tsvetolin Shulev