-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetson Orin Nano PWM only works on Pin 33 #105
Comments
Once python is running with GPIO, this seems to be able to control the duty cycle in another shell: echo 0 > /sys/class/pwm/pwmchip3/export
echo 20000000 > /sys/class/pwm/pwmchip3/pwm0/period
echo 10000000 > /sys/class/pwm/pwmchip3/pwm0/duty_cycle
echo 1 > /sys/class/pwm/pwmchip3/pwm0/enable |
Did you change the pinmux so they are pwm? |
Does the code run without crashing and the output signal is correct for pin 33 but the |
Yes actually this is how the underlying python code control GPIO PWM. You can do this to control it manually |
Yes, that's correct. |
There's no software PWM support, right? I'm just thinking of workarounds until this can get fixed. |
No software PWM support. Maybe you can use external servo driver like this |
Can you show me the output of sudo busybox devmem 0x02440020 |
$ sudo busybox devmem 0x02440020
0x00000404
$ sudo busybox devmem 0x02434080
0x00000404 |
I cannot reproduce this on my hardware. I will let our hardware engineer know to look into this further. |
If you have instructions on how you got yours working, I could double check that I'm doing it correctly. |
I tested PWM using https://github.com/NVIDIA/jetson-gpio/blob/master/samples/test_all_apis.py jetson-gpio/samples/test_all_apis.py Line 38 in af27a7d
|
Nice! I will try it in the morning. |
Here is one thing to note:
|
Am I correct in that to test pin 15, I connect pin 15 to 19 instead of 33 - 19? If I do that, I see this:
|
Oh it seems that I figured it out. It's quite interesting. Order matters. If I do all the pin setup one at a time it is working. This will NOT WORK: GPIO.setup(lpin[0], GPIO.OUT)
GPIO.setup(rpin[0], GPIO.OUT)
GPIO.setup(lpin[1],GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(rpin[1],GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(lpin[2], GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(rpin[2], GPIO.OUT, initial=GPIO.LOW)
lpwm = GPIO.PWM(lpin[0], hz)
rpwm = GPIO.PWM(rpin[0], hz)
lpwm.start(0)
rpwm.start(0) This WILL work: GPIO.setup(lpin[1],GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(rpin[1],GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(lpin[2], GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(rpin[2], GPIO.OUT, initial=GPIO.LOW)
# Setup this pin and pwm first
GPIO.setup(lpin[0], GPIO.OUT)
lpwm = GPIO.PWM(lpin[0], hz)
lpwm.start(0)
# then this one
GPIO.setup(rpin[0], GPIO.OUT)
rpwm = GPIO.PWM(rpin[0], hz)
rpwm.start(0) I'm not sure if it's a bug or if it's a hardware limitation that should be documented. |
Hello,
Pin 33 works with PWM. Pin 32 and pin 15 do not. It's just either on or off. I'm using a L293 motor controller and if I switch the pins for left and right motors, the other motor exhibits the same behavior.
Here's my sample code:
Some more info for you:
At 50% duty cycle on pin 32 and 33:
The text was updated successfully, but these errors were encountered: