Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

NanoPi Neo PWM pin

Featured Replies

With a little shell script I can switch gpio6 on/off:

#!/bin/sh

# PWM1 / GPIOA6
P=6

G="/sys/class/gpio/gpio${P}"

if [ ! -d "${G}" ]; then
  echo "Exporting GPIO${P}"
  echo ${P} > /sys/class/gpio/export
  echo out > ${G}/direction
fi

i=100
while [ "$i" -gt 0 ]; do
  i=`expr $i - 1`
  sleep .2
  echo 1 > ${G}/value
  sleep .1
  echo 0 > ${G}/value
done

if [ -d "${G}" ]; then
  echo "Unexporting GPIO${P}"
  echo ${P} > /sys/class/gpio/unexport
fi

but I dont see anything which could enable PWM on this pin:

root@nanopineo:~# ll /sys/class/gpio/gpio6/
total 0
-rw-r--r-- 1 root root 4096 Feb 21 11:38 active_low
lrwxrwxrwx 1 root root    0 Feb 21 11:38 device -> ../../../sunxi-pinctrl
-rw-r--r-- 1 root root 4096 Feb 21 11:37 direction
-rw-r--r-- 1 root root 4096 Feb 21 11:38 edge
drwxr-xr-x 2 root root    0 Feb 21 11:38 power
lrwxrwxrwx 1 root root    0 Feb 21 11:38 subsystem -> ../../../../../class/gpio
-rw-r--r-- 1 root root 4096 Feb 21 11:37 uevent
-rw-r--r-- 1 root root 4096 Feb 21 11:38 value

Is it possibe to enable PWM on the NanoPi Neo via sysfs?

 

The above link looks to be exactly what I was looking for back in the summer and failed on.

I didn't realize that if the pins were multiplexed they needed configuring in the kernel.

PWM is important to me for a number of reasons. I'll be giving this a go.

 

The link talks to legacy kernel with .fex files.

I presume there is a similar tweak to Device Tree for Development kernel which I have been a bit Leary of due to there only being 24 hours in a day.

Anyone able to offer some insights as to what to tweak if using the bleeding edge kernel?

 

Thanks

Allan

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.