Hi,
I’m trying to use PWM on Xavier devkit at pin 18 which I’ve found labelled as GPIO35_PWM3.
I’m new to this and would like to avoid HW damage =)
Which chip is used for PWM3? 2 or 3?
jetson-xavier ~ # ll /sys/class/pwm/
lrwxrwxrwx 1 root root 0 Sep 20 10:43 pwmchip0 -> ../../devices/3280000.pwm/pwm/pwmchip0/
lrwxrwxrwx 1 root root 0 Sep 20 10:43 pwmchip1 -> ../../devices/c340000.pwm/pwm/pwmchip1/
lrwxrwxrwx 1 root root 0 Sep 20 10:43 pwmchip2 -> ../../devices/32c0000.pwm/pwm/pwmchip2/
lrwxrwxrwx 1 root root 0 Sep 20 10:43 pwmchip3 -> ../../devices/32f0000.pwm/pwm/pwmchip3/
lrwxrwxrwx 1 root root 0 Sep 20 10:43 pwmchip4 -> ../../devices/39c0000.tachometer/pwm/pwmchip4/
I have the following script
#!/bin/bash
echo 0 > /sys/class/pwm/pwmchip${1}/export
echo 1000000 > /sys/class/pwm/pwmchip${1}/pwm0/period
echo 500000 > /sys/class/pwm/pwmchip${1}/pwm0/duty_cycle
echo 1 > /sys/class/pwm/pwmchip${1}/pwm0/enable
echo "Beep"
sleep 1
echo 0 > /sys/class/pwm/pwmchip${1}/pwm0/enable
echo 0 > /sys/class/pwm/pwmchip${1}/unexport
used as ./beep.sh [2 or 3 for the controller]
For both controllers I get no error but also no signal as output
In the device tree sources I see
pwm@32c0000 {
status = "okay";
};
pwm@32f0000 {
status = "okay";
};
But no other configuration.
I downloaded the pinmux for Xavier but I’m not sure how to use it.
Is it OK to change for GPIO35:
- SFIO1 GP_PWM5 → GP_PWM3
- Customer usage: GPIO3_PH.00 → GP_PWM3
- Pin direction: Input → Ouput
But then, there’s a Ball name > UART > GP_PWM3 which has no signal name but is set to Customer usage GP_PWM3. Same for GP_PWM2. What should I do there?
What I need is to be able to out PWM signal (3.3V if possible) on pin 18.
Any hint or guidance would be very appreciated =)
Thanks,
-Damien