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.

How to configure pulse-width modulation with timer on DM8148

I'm trying to control the brightness of LCD back light with PWM with TDMXEVM8148BTA. I've read DM814X Tech Ref section 14 (sprugz8.pdf). It mentioned that timer can be used to generate PWM output signal. However the data sheet is not quite clear on the implementation. Basically, I need to be able to configure duty cycle, period and prescaler for clock. Has anyone ever done PWM control with this processor? Any comment will be greatly appreciated.

Thank you.

Jiewen

 

 

  • Jiewen,

    Just to clarify here...

    Are you using your own LCD daughter card on the EVM or are you using the Mistral daughter card and LCD board?

    If you are using the Mistral solution then the backlight PWM is connected to an I2C controlled expander/LED driver which has integrated PWM generators.

    On the other hand, if you have your own hardware where the LCD PWM control is connected to the DSP PWM output then the configuration will be done through DSP registers.

    Do you have your schematics which show your PWM control connectivity so that we can best help you?

    BR,

    Steve

  • Hi Steve,

    I think we are going to have our own LCD card. However I don't have the schematic for it. Currently, I need to generate a PWM signal to control LCD back light. After couple of attempts, I managed generating a PWM signal with a timer output. So now I am able to probe the PWM signal. Next step will be to find a LCD card to connect to EVM, and control the back light with the PWM signal.

    Thank you very much for your help.

    Best Regards,

    Jiewen 

     

     

     

  • Hi Jiewen,

        I'm using the PWM function to control buzzer sound or LED blinking. I use Timer5 for this purpose. When I configure relative registers, the timer counter is increasing and it would reset while overflow. Unfortunately I don't see any change in the timer output signal.

        Is there any difference from TRM for you to generate PWM signal successfully? I appreciate it if you could share your experience for PWM control.

     

    Regards,

        Eric

  • Hi Eris,

    I'm using Timer2, so I set pin mux as 0x481408A8 = 0x60040 (Pin 43), the timer control register setting is 0x48040038 = 0x1802 (Toggle, Trigger, AR and ST).

    In addition, trigger register (reg 0x44) needs to be written in order to reload the timer (reg 0x40). With this settings, I'm able to generate PWM signal.

    Hope this helps.

    Regards,

    Jiewen

     

     

     

  • Hi Jiewen,

        By comparing your setting, I found the reason why I can't generate PWM signal. I set the control register TCLR field CPO_CFG[14] as 1 to make PORGOCFG drive 1 and field TRG[11:10] as 2 to trigger on overflow and match, but the register TMAR was not set properly. The output signal always keeps at high level.

        After I set appropriate values of TCLR and TMAR, PWM is generated. And the duty and frequency are able to adjust.

        Thank you very much for your great help.

     

    Regards,

        Eric

  • Hi Jiewen,

    I'm trying to configure Timer2, for Dm814xEVM.

    I'm able to configure the Timer2 successfuly and am able to generate PWM at the u-boot level.

    But i'm not able to understand where should I make the modifications specific to timer(register setting) as  mentioned above.

    I've tried building a module as mentioned in the below link, but i'm not able to access timer2 in this manner.

    http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#Example:_Using_Timer5_from_a_loadable_module

    Kindly guide me in this regard.

    Regards,

    Kiran

  • If you wish to activate the timers from M3, you could use #define to access memory registers necessary to initialize the pinmux, and timer registers.

    for example:

    #define REGISTER_NAME (volatile UInt32*)(0x12345678)

    and then use

    *REGISTER_NAME = 0x1234;

    to write to the registers;

    in my application, I do this in the sensor driver.

    after you have the definitions, you can pinmux the timer output pin and initialize the timer the same way you did in uboot.

    if you're experiencing problems, make sure you're not muxing the pin you need elsewhere like in the kernel or u-boot.