Apalis iMX 6 PWM4 & Backlight PWM Sharing

Based on the Apalis iMX6 datasheet, the PWM4 and Backlight PWM are shared as shown below. In our design, the PWM4 is currently used to control the power to a heater to control temperature.

Question: Does the connected LCD backlight brightness varies when the PWM4 is actively used to control heater power at the same time? Or PWM4 and Backlight PWM operation do not interfere with each other?

1672-toradex.jpg

Hello @jerry.lee and Welcome to the Toradex Community!

As written in the Datasheet, PWM4 (SD4_DATA2) is exported on SODIMM Pin 8. The same signal can be exported to the SODIMM Pin 239 by enabling the output of the buffer. In this configuration, changes to PWM4 applies also to the backlight PWM.
However, if you disable the output of the buffer, then you can drive the SODIMM Pin 239 independently from SODIMM Pin8 by Software.

Best regards,
Jaski

With this info, we would want to permanently disabling the output buffer to avoid backlight brightness variation when we are using PWM4 in our application.

Question: For varying backlight brightness, would driving a GPIO at variable frequency be good enough for the job?

Thanks, Jerry

Hi @jerry.lee , I believe that would be up to the display in question and at the end, you would be kind of hacking the GPIO to emulate the PWM signal through software… If the display cannot admit a continuous signal (rather than PWM), can I suggest to use another PWM output rather than PWM4?

Kind regards,
Alvaro.

Unfortunately all the other 3 PWM channels are already used on other application. The LCD can admit a continuous signal but we would like it’s brightness to be adjustable.

In this case, I think we can only know the answer through actual testing when we get our display.

Thanks,
Jerry

Hi @jerry.lee

I think this should be possible. While you are waiting on your display, you should find out which frequency you will need for the PWM signal. Once you know this, then you can already try to write some code similar to following as user application and check the output.

if (count <= (T_ON) ) //If time less than on time
        RD1=1; //Turn on GPIO
    else
        RD1=0; //Else turn off GPIO

    if (count >= (T_TOTAL*10) ) //Keep it turned off until a new cycle starts
        count=0;

Best regards,
Jaski

Hi, I don’t mean to hijack this thread, merely to hitch-hike on it for a bit.

I am using an apalis-imx6Q with the apalis eval board, and toradex yocto release 3.0b4.

I have the exact same issue and I just wanted to ask for clarification on one item as well as a question.

Our board, currently under development, also requires that the PWMs 1-4 be configured as GPIOs.

This of course means that the backlight PWM (kernel infrastructure - /sys/class/backlight/) no longer functions, and pin 239 follows pin 8 (as expected, I think).

Question 1. This is expected correct? There is no way to set pwms1-4 to GPIOs, yet still have some PWM signal magically output on pin 239?

Second question - if I wanted to disable that buffer so I could use pwm4 for backlight purposes (pin 8), but re-use pin 239 as an independent GPIO, how would I disable that buffer? In the DT I presume, but can you tell me what change would have to be made to do that?

(I’m currently using the imx6q-apalis-eval.dtb DT if that matters).

Thanks!

Hey @jtrulson , welcome to the Toradex community! I think that it is for everyone’s best interest to open a new question with your exact environment info (but feel free to relate to this question to give further context). Sorry for the inconvenience but many thanks in advance!

Just quickly answering your question:

  1. PWM signals have defined pinouts, that you can quickly check in both the module datasheet and our pinout designer.
  2. You would need to define the EIM_A25 pin as GPIO ON (buffer is active low). You have some details on how to do so here (https://developer.toradex.com/knowledge-base/device-tree-customization-examples#General_Purpose_Input_Output_GPIO) and how to set the pinmux here (https://developer.toradex.com/device-tree-customization#Pinmux_iMX6)