Hardware PWM

Hello,

Have any hardware PWM in TX1 for motor control, Currently, I use the software PWM(using usleep()), but this kind of signal keep shifting all the time.

Thanks for any suggestion.

TX1 has no such PWM can be used for motor control directly. You can try pin LCD_BL_PWM and find related registers setting in TRM, but you will have to tune it by yourself.

Hi Trumany,

I found a PWM Control which start address is 7000:a000.
I also see the PWM device pwm0 ~ pwm3 from the path of /sys/kernel/debug/pwm and the message show as below.

pwm-0 ((null))        ):
pwm-1 (pwm-regulator  ): requested enable
pwm-2 ((null))        ):
pwm-3 (pwm-fan.43     ): requested enable

Currently, I couldn’t search additional information about the PWM control.
Is there any reference to the device such like the control method?

Thanks

Hi
You can check this link.
http://elinux.org/Jetson/PWM#PWM_directly_in_Tegra

Hi ShaneCCC,

Did you know what’s the unit of such PWM signal?

Thanks

@Ray
It could be duty cycle/frequency/period

Hi ShaneCCC,

Thanks for your info, and sorry to confuse you.
Actually, what I want to question is the frequency, the limitation of frequency(maybe 10k or faster)?
Anyway, I will try this method.

Thanks

Hi ShaneCCC,

May I know how fast the frequency we could generate by this way?
After confirming the spec, the pwm period of our device is 1.15 us, a very fast signal.
If we couldn’t generate so fast the PWM signal, I need to search other solution.

Thanks

@Ray
Please dowmload the TK! TRM to check the chapter 34.0 PWM CONTROLLER

Hi ShaneCCC,

Thanks for your reply, I have already found the relative information.
According to the description in the link Jetson/PWM - eLinux.org, before test the PWM1, we need to execute “echo 57 > /sys/class/gpio/export” and “echo 57 > /sys/class/gpio/unexport”, what about the setting for TX1, Is’t also number 57?

Thanks

There’s no gpio control for the TX1.

Hi ShaneCCC,

How can I find the hardware pin define in TX1, the description in the link “Jetson/PWM - eLinux.org” is for TK1?

Thanks

Per pinmux , there are LCD0_BKLT_PWM and FAN_PWM that can be used as PWM pins.

Hi ShaneCCC

Thanks

Hi,

I have already controlled the LCD0_BKLT_PWM form the method which the web(Jetson/PWM - eLinux.org) described.
Here have a problem that the max PWM frequency we could generate is 188kHz(if the setting value for the period is smaller than 8000), but the max frequency the TRM mentioned is 48Mhz.
What the PWM period we need is smaller 0.5 micro seconds, could it possible to modify the driver or another way to generate this PWM?

Thanks for any advice

Could you try apply this patch to try again.
842064b.diff.zip (768 Bytes)

Hi ShaneCCC,

Thanks for your help, but It seems had the same result that if the period values smaller than 8000, the PWM period becomes 5.4 micro seconds(10.66 micro seconds if values is 8000).

Thanks

Hi ShaneCCC,

It’s my mistake to misunderstand the PWM spec, after confirming the TRM again, the max PWM frequency should be 48MHz/256 => 5.3 micro second period.

Thanks