Jetson TX2 PWM

I am using TX2 module with Orbitty Carrier board. I want to adjust the stepper motor speed, I need pwm for this. I can’t see enough precision PWM using GPIO pins.
How do I get PWM using TX2 module orbitty Carrier board or a different NVIDIA model?

Thank you.

hello yasincuskun,

please refer to Fan Management by programming the PWM controller as an example.
thanks

Hi,

Here are some commands Connect Tech Inc has provided for fan usage with their carriers. To change the PWM cycle, you may use the following command you may set the duty cycle between 0-255.

For L4T 32.x.x PWM Fan with NVIDIA Jetson:

Fan PWM OFF
#sudo echo 0 > /sys/devices/pwm-fan/target_pwm

Fan PWM ON
#sudo echo 255 > /sys/devices/pwm-fan/target_pwm

L4T 28.2.x PWM fan with NVIDIA Jetson:

Fan PWM OFF
#sudo echo 0 > /sys/kernel/debug/tegra_fan/target_pwm

Fan PWM ON
#sudo echo 255 > /sys/kernel/debug/tegra_fan/target_pwm

Thanks!

Thank you for your answer JerryChang

Thank you for your answer jgananam. Can I adjust the frequency of PWM?

hello yasincuskun,

did you mean adjust duty cycle to control the percentage of a ratio of pulse duration, please refer to Topic 1057330 for an example.
you should also check debugfs for the current state of PWM devices.
for example,

$ sudo cat /sys/kernel/debug/pwm

Hello JerryChang,
First of all, thank you again for your answers.
Using https://devtalk.nvidia.com/default/topic/1057330/jetson-nano/what-pins-can-be-used-for-pwm-control-except-33-in-samples/post/5386543/#5386543 here I can set the duty cycle and frequency. But I don’t know which pin to see the outputs I set.
The other option is that I can see the PWM at the fan output, but I can’t set the frequency on it.

Hi Yasincuskin,

255 is an 8 bit number we echo into the folder to run at maximum. In addition, the PWM cycle length is 250nS. So at max frequency it should be 1/(250nS).

Please let me know if that answers your question.