After viewing countless relevant topics relating to my problem I am left stuck. I am attempting to utilize the pwm0 located on pin 32 of the Jetson Nano 2GB Dev Kit, and after using;
sudo /opt/nvidia/jetson-io/jetson -io.py
to enable the pwm0 then after running a simple program to confirm that a PWM signal is being generated and wiring the pin 32 to an oscilloscope, I find that instead of seeing a PWM signal I am left with an output of 3.3 V.
Thank you for the reference although helpful for the future, at this point that forum doesn’t quite help me understand why there is no PWM signal being generated from the Jetson.
in response to “Unable to get multiple PWM pins to work simultaneously - #5 by KevinFFF”, and after running the code below.
/////////////////Start of Code
import time
import math
import Jetson.GPIO as GPIO
def main():
pwm_pins = [32,33]
# Pin Setup:
# Board pin-numbering scheme
GPIO.setmode(GPIO.BOARD)
# set pin as an output pin with optional initial state of HIGH
GPIO.setup(pwm_pins, GPIO.OUT, initial=GPIO.HIGH)
_frequency_hz = 50
_duty_cycle_percent = 25
incr = 5
# p1 is a PWM object.
# ERROR the order of the p1 and p2 initialization determines which one works
# and which one fails. Whichever is initialized last will work, and whichever is
# first will fail. (verified with oscilloscope and stepping through with pdb).
GPIO.setup(pwm_pins[0], GPIO.OUT, initial=GPIO.HIGH)
p1 = GPIO.PWM(pwm_pins[0], _frequency_hz)
p1.start(_duty_cycle_percent)
GPIO.setup(pwm_pins[1], GPIO.OUT, initial=GPIO.HIGH)
p2 = GPIO.PWM(pwm_pins[1], _frequency_hz)
p2.start(_duty_cycle_percent)
print("PWM running. Press CTRL+C to exit.")
try:
while True:
time.sleep(0.25)
if _duty_cycle_percent >= 100:
incr = -incr
if _duty_cycle_percent <= 0:
incr = -incr
_duty_cycle_percent += incr
p1.ChangeDutyCycle(_duty_cycle_percent)
p2.ChangeDutyCycle(_duty_cycle_percent)
finally:
p1.stop()
p2.stop()
GPIO.cleanup()
if name == ‘main’:
main()
//////////////////END of Code
I receive the following from an oscilloscope where the Yellow signal is from Pin 33 and the green signal is Pin 32
From the signals provided above we can gather that the Jetson is failing to generate a PWM signal.
**Please note that originally I had just copy and pasted the code from the other forum where pin 15 was a PWM pin (that is not the case for the jetson nano) and I was notified that pin 15 was not a PWM pin. Additionally I have also followed the steps from Mar 8th and the output on the oscilloscope is practically the same.
I am using a micro-SD, and I have attempted to use the pinmux spreadsheet however I am not quite sure how to operate it. Additionally, when I try to use the pinmux spreadsheet I receive the following message.