What pins can be used for PWM control except 33 in samples

Thank you for the update.
I gave up using PWM in Nano.

hello WayneWWW.

The details about my operation is previous post URL link.

https://devtalk.nvidia.com/default/topic/1056351/jetson-nano/hardware-pwm-update-with-jetson-gpio/post/5358544/#5358544

https://devtalk.nvidia.com/default/topic/1055398/jetson-nano/how-to-use-the-jetson-nanos-pinmux-spreadsheet-/post/5352144/#5352144

And Next, I tried it.
"Jetson Nano Developer Kit 40-Pin Expansion Header Configuration "

Then the PDF shows Last command,

cd Linux_for_Tegra/
sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1

All of my Jetson Nano’s data was disappeared.

SD card data was crashed. (U-Boot console said that ‘bad sd card’! )
(I don’t know why this happened.)

Maybe I will try it one more again after JetPack’s update…
thanks.

devemin.

Hi devemin,

I am still not sure what did you do. In your first link, I saw your comment said you are tying pin #22. Pin#22 is using for either gpio or spi input. It cannot be a pwm pin…

And I tried it. "Jetson Nano Developer Kit 40-Pin Expansion Header Configuration "

Yes, please tell us what did you modify in this spreadsheet. After that, you should need to follow up all the steps from the app note.

All of my Jetson Nano’s data was disappeared.
Yes, sorry for that. It is expected… full flash would erase the data.

Hi WayneWWW.

Oh you are too kind man! Thanks for reply!

In first Link, EnriqueR said that No.22 is correct, But He was wrong.

I tried it about both of No.33 & No.22.

And I will send my cofigration files in attachment file in this post.

I forgot detail about a week ago, maybe I change 40pin Header No.7, 33, 32, 38, 40, 35, 12, 19, 21, 23, 24, 26
Usage and GPIO Input/Output in spreadsheet. (PWM, I2S, SPI)
I didn’t change in other column…maybe. (But ‘INT PD/PU’ is uncertain. I forgot, sorry.)

In dtsi file, I add the sentence.

suspend_gpio: system-suspend-gpio {
 			status = "okay";
 			gpio-hog;
 			output-high;
 			gpio-suspend;
 			suspend-output-low;
 			gpios = <
 				TEGRA_GPIO(A, 6) 0
 				>;
 		};

https://devtalk.nvidia.com/default/topic/1055398/jetson-nano/how-to-use-the-jetson-nanos-pinmux-spreadsheet-/post/5351659/#5351659

thanks.

[This file was removed because it was flagged as potentially malicious] (417 KB)

I think we should narrow down this issue since we are only discussing the pwm pin #32 or #33. Could you just change one pin (#32 or#33) in spreadsheet and follow up the steps from document?

ok, I will try it later.

Please wait a few days…

thanks.
devemin

Hello.

I am sorry that I still didnt’t try this yet.

I was very busy to hacking this robot for $200 with UART command servo x25 pieces.

https://twitter.com/search?q=%23プリメイドAI&src=typed_query

By the way, is there anyone else who tried PWM ? (Anyone or nVidia’s engineer ?)

Anyone can get PWM pulse ?

I decided to use STM32 microcomputer’s PWM instead of Jetson Nano’s function.

Jackchen said

I gave up this too.

If it becomes easier to use Jetson Nano’s PWM, I will try it.

thanks for this forum.
devemin

I was able to enable & use PWM using direct register access (See Tegra X1 Technical Reference Manual for details https://developer.nvidia.com/embedded/downloads#?search=Tegra%20X1):

# (All commands as root, use sudo if needed)
# Enable Pin 32 / PWM0
busybox devmem 0x700031fc 32 0x45
busybox devmem 0x6000d504 32 0x2

# Enable Pin 33 / PWM2
busybox devmem 0x70003248 32 0x46
busybox devmem 0x6000d100 32 0x00

# Then enable & control the pwm, e.g.
cd /sys/devices/7000a000.pwm/pwm/pwmchip0
echo 0 > export  # Control PWM0 on Pin 32
cd pwm0
echo 20000000 > period
echo 1500000 > duty_cycle
echo 1 > enable
2 Likes

Thanks!!!

Wow!!!

Mr. ashtuchkin, You are very cool !

Your help is the most useful in the world.

I tried it with “sudo su” and logic analyzer, then I can get the PWM pulse !
(on jetson-nano-sd-r32.2.1 image, default settings. )

Very thanks!
devemin

THANK YOUUUUU!!!
What are the units for the Period and the duty cycle that you are setting?

It’s nanoseconds.

Be aware that PWMs on Jetson only have 8 bit duty cycle precision and the period is a 13 bit divider from 187.5kHz, so the actual values will be approximate.

but i got an error, why?
root@dlinano-desktop:/home/dlinano# busybox devmem 0x700031fc 32 0x45
root@dlinano-desktop:/home/dlinano# busybox devmem 0x6000d504 32 0x2
root@dlinano-desktop:/home/dlinano# busybox devmem 0x70003248 32 0x46
root@dlinano-desktop:/home/dlinano# busybox devmem 0x6000d100 32 0x00
root@dlinano-desktop:/home/dlinano# cd /sys/devices/7000a000.pwm/pwm/pwmchip0
root@dlinano-desktop:/sys/devices/7000a000.pwm/pwm/pwmchip0# echo 0 > export
bash: echo: write error: Device or resource busy

Maybe the device is already opened somewhere else? I don’t know, I’m not an expert.

I was using this command to understand the current state of the devices:

sudo cat /sys/kernel/debug/pwm

ashtuchkin,thank you very much, you are right, the PWM0 is already opened as lightbar when the nano is booting.

dlinano@dlinano-desktop:~$ sudo cat /sys/kernel/debug/pwm
[sudo] password for dlinano:
platform/70110000.pwm, 1 PWM device
pwm-0 (pwm-regulator ): requested enabled period: 2500 ns duty: 0 ns polarity: normal

platform/7000a000.pwm, 4 PWM devices
pwm-0 (lightbar ): requested enabled period: 10000000 ns duty: 10000000 ns polarity: normal
pwm-1 (pwm-regulator ): requested period: 8000 ns duty: 1440 ns polarity: normal
pwm-2 ((null) ): period: 0 ns duty: 0 ns polarity: normal
pwm-3 (pwm-fan ): requested enabled period: 45334 ns duty: 0 ns polarity: normal

i want to use pwm0 in my way, like the pwm2, how can i do?

I don’t know what lightbar is. You probably need to research what that is and close it’s connection to pwm0.

Is there no one who actually got pwm running using ‘Jetson Nano Developer Kit 40-Pin Expansion Header Configuration’? I tried it myself and couldn’t get it working.

Enabling pwm directly in the memory as ashtuchkin said works but is not really satisfying in the long run.

I’ve also read in different posts that the spreadsheet currently generates faulty dtsi files. Any info from the nvidia developers whether it’s possible to enable pwm using the spreadsheet at the moment?

Thanks ashtuchkin for guide. when i try, pin 33 worked good, but Pin 32 error:

write error: Device or resource busy

and when check state of PWM:

root@jetbot:/sys/devices/7000a000.pwm/pwm/pwmchip0# sudo cat /sys/kernel/debug/pwm
platform/70110000.pwm, 1 PWM device
 pwm-0   (pwm-regulator       ): requested enabled period: 2500 ns duty: 0 ns polarity: normal

platform/7000a000.pwm, 4 PWM devices
 pwm-0   (lightbar            ): requested enabled period: 10000000 ns duty: 10000000 ns polarity: normal
 pwm-1   (pwm-regulator       ): requested enabled period: 8000 ns duty: 1440 ns polarity: normal
 pwm-2   (sysfs               ): requested enabled period: 1000000 ns duty: 0 ns polarity: normal
 pwm-3   (pwm-fan             ): requested enabled period: 45334 ns duty: 0 ns polarity: normal

Please help me!!!

1 Like

Thank you very much!