How to set PWM gp_pwm9_pm0 to 83 kHz on Jetson Thor r38.2.1

Hi NV’s experts:

I am currently working with the Jetson Thor T5000 r38.2.1 and trying to generate a 83 kHz (duty cycle: 90%) square wave using the gp_pwm9_pm0 pin.

Current Setup:
root@tegra-ubuntu:/home/nvidia# echo “pllp_out0” > /sys/kernel/debug/bpmp/debug/clk/pwm9/parent
root@tegra-ubuntu:/home/nvidia# echo 0 > /sys/class/pwm/pwmchip2/export
root@tegra-ubuntu:/home/nvidia# echo 91000 > /sys/class/pwm/pwmchip2/pwm0/period # 79.1 kHz
root@tegra-ubuntu:/home/nvidia# echo 81000 > /sys/class/pwm/pwmchip2/pwm0/duty_cycle
root@tegra-ubuntu:/home/nvidia# echo 1 > /sys/class/pwm/pwmchip2/pwm0/enable

root@tegra-ubuntu:/home/nvidia# echo 90000 > /sys/class/pwm/pwmchip2/pwm0/period # 88.1 kHz

Observations:
Clock Source (Parent): pllp_out0 at 202.5 MHz.
Result A: Setting the period to 91k yields ~79.1 kHz.
Result B: Setting the period to 90k yields ~88.1 kHz.

Issue:
Despite attempting to interpolate between these values, I am unable to hit the target frequency of 83 kHz. It seems the frequency resolution is too coarse with the current clock configuration.

Is there a recommended PWM setting that provides finer granularity for this specific frequency (83 kHz)?

Any insights or recommended register configurations would be greatly appreciated.

Hi jerome.cheng,

Are you using the devkit or custom board for Thor?

Have you tried using default osc as parent clock?

It may not achieve the exact 83kHz due to the resolution.
What’s the acceptable frequency range for your use case?

Could you also verify with the latest Jetpack 7.1(r38.4.0)?

Hi Kevin,

I am using a custom board and have tried the default 27 MHz oscillator. The measured results are 52.6 kHz and 105 kHz.

I checked with the vendor, and they have not verified the acceptable frequency range.

I will further verify this using JetPack 7.1.

Please help to clarify what’s the required PWM frequency in your use case and also verify if there’s the similar result with Jetpack 7.1.

The PWM behavior is different on Jetpack 7.1.

I have identified a solution to resolve the issue on Jetpack 7.0.

Thank you.