To control IR LED, we required PWM on GPIO07, which supports PWM as per pinmux sheet
We had done the following steps,
Change the gpio pin to pwm pin in pinmux spreadsheet
2. Rebuild dtb file with updated dtsi files
3. Device tree flashing with updated dtb files
4. Use the debugfs to control the pwm
But using the below steps, we didn’t get PWM signal on the required pin
Could you please clarify if any additional configurations are needed other than pin muxing and exporting pin using sysfs entries to enable PWM without the above two steps of register writes, how we get pin-number for PWM as we are using GPIO07 as per above-mentioned post it comes under pin32, and what is the Upper and Lower Limit of PWM Frequency on Jetson Nano?
may I also know which JetPack release you’re using.
you’ll need to update pinmux spreadsheets since GPIO07 it’s by default configure as GPIO pin, i.e. modify GPIO3_PV.00 as PM3_PWM0.
please see-also similar topics for using PWM on Nano.
for example, Topic 122492, Topic 157462.
Could you please clarify the above devmem read/write steps are required to enable PWM even though we had exported and enabled the PWM using sysfs? Or anything to be added in during pinmuxing, and What is the Upper and Lower Limit of PWM Frequency on Jetson Nano?
how you update the pin configuration? you should at least having partition update to re-flash DTB partition to apply those settings.
furthermore,
you may check the clock sources to review the possible rate of a PWM controller.
let’s assume the clock source is pllp_out0 which has a rate of 102 MHz.
so…
Max Rate = 102Mhz/ 256 = 398437 Hz = 2510 ns
Min Rate = 102Mhz/ (256* 2^13) (i.e. 13-bits Frequency divider (bits 0:12)) = 48.63Hz = 20561324 ns
how you update the pin configuration? you should at least having partition update to re-flash DTB partition to apply those settings.>
We have used the following command to flash the device tree only sudo ./flash.sh -r -k DTB <configfile> mmcblk0p1
furthermore,
you may check the clock sources to review the possible rate of a PWM controller.
let’s assume the clock source is pllp_out0 which has a rate of 102 MHz.>
How we can find the respective clock source for the pin 206 which is PM3_PWM0 as per pinmux sheet configured as PWM?
As per our use case, the same PWM is controlling IR LED By default the state of IR LED is high, Could you please provide clarity on how we can change the state of PWM pin as low by default? Any changes to be made in the pinmux sheet and in device tree as per our use case?
```you should configure the pin as Int PD.
lcd_bl_pwm_pv0 {
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
As per our use case, we have given the default state of PWM pin as pull up to turn off the IR LED by default as shown below in pinmux sheet
``` lcd_bl_pwm_pv0 {
nvidia,pins = "lcd_bl_pwm_pv0";
nvidia,function = "pwm0";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
};
But it is not reflected, when jetson nano is booted. IR led is still in On by default, it is in Active Low state
When we tried to disable after exporting manually, the PWM and set PWM frequency and duty cycle and given ACTIVE HIGH, it is working fine.
echo 0 > /sys/class/pwm/pwmchip0/export
echo 2500000 > /sys/class/pwm/pwmchip0/pwm0/period
echo 250000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable```
Any other solution is there to fix the issue?
Can we give Drive1 instead of Pull Up in the pinmux sheet?
PD/PU is to enable resistor of pull-up/down; Drive 0/1 is to enable CMOS output low/high.
Could you please clarify more on the above point, how it impacts the default state of a GPIO/PWM pin when we configure GPIO/PWM signal as pull-up/down or Drive 0/1 in the pinmux sheet?