When I press a button, I send a PWM (servo) signal to pin 15 of my Jetson Orin Nano. I am aware that the library has no function to read PWM, but I was able to write a custom code that worked with another system. I registered an ISR function that is supposed to be called and read the PWM. Currently, the ISR is never called. I made another test code using gpioRead() to print the pin level in the terminal and there is no change when I press the button. Finally, looking with an oscilloscope, I can see the PWM signal, but it is only 300mV at high state when connected to the Jetson. When my remote controller is not connected to the Jetson, the PWM signal level is fine.
I don’t think the issue is related to the library itself, but rather a configuration pin issue. I checked the PINMUX spreadsheet, and if I understand correctly, pin 12 is GPIO 15 which is configured as PD as initial state. I guess that I need to change it to Z, right?
First of all, if there is any other pin I can connect to that has directly the right configuration, I am happy to change it.
Otherwise, I understand I need to change the initial state of the pin in the spreadsheet and then apply these updates to the Jetson. I am really confused about how to do that, this is something totally new for me. First, the spreadsheet contains two sheets: which one should I use? Then, I see I can generate 3 .dtsi files, but what are the next steps?
Ok I see. In my application, I want to read a PWM signal, so I think the pin should be in GPIO mode, no? And if I understand correctly, this should be the case by default…
GPIO is not the same as PWM…
PWM needs hardware suppport, and while you can use a GPIO pin to act as PWM, it’s only software simulation and not as precise as real PWM.
The pinmux spreadsheet gives you the option to config the pin as PWM.
But I thought this applies only when you want to generate a PWM as output, while I want to read a PWM coming as input to the Jetson. But maybe I am confused and the pin has to be set as PWM also for reading?
Will do that and let you know.
I am just a bit confused (again), because if I set the pin as GP_PWM1, it can only be an output. So will it be possible to read the PWM signal?
And what should be Req. Initial State?
Oh, OK.
So I might be wrong.
Can you please first confirm if a normal GPIO, instead of PWN, signal is sent to the pin, then is the voltage read correctly?