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.

OpiPC PWM on GPIO?

Featured Replies

Hi!

 

I'm using a mosfet to control a fan based on temperature on my opipc, but now it just turns on and off.

I'd like to control the rpm with pwm, but I cannot use any of the pins with wiringop :S

 

I read on an other forum that the h3 has only one pwm, but which one is the pwm pin, and how could I use it?

 

Thanks in advance!

In case you're using Armbian there is absolutely no need for a fan. Just attach a heatsink for $0.5 and you're done. We ship with sane thermal settings so a heatsink is enough.

 

Regarding PWM: We're enabling PWM support in kernel but I don't know whether we build the module or not. What I know for sure is that PWM needs a change to script.bin since it's not enabled by default.

 

Please read on from here to get the idea what's missing: https://www.olimex.com/wiki/How_to_add_pwm

 

You would've to use bin2fex/fex2bin to adjust contents of /boot/bin/orangepipc.bin, reboot and try out 'modprobe pwm-sunxi' at least. About this WiringOP stuff I've not the slightest idea why anyone wants to use this library at all since all this stuff is easily accessible through sysfs as outlined in Olimex' wiki. :)

The pwm pin is the middle pin of the serial debug port (3 pins near power connector)

You can control this pin by writing directly to the control/data register.

 

http://linux-sunxi.org/H3#Documentation (datasheet V1.1)

(p 317 H3 manual  011 PWM0 dataregister for port PA5)
(P.188 the control register for PWM is at 0x01C21400)

 

I wrote a script to blink a LED using this technique. It could easily be used to control a motor. (you will need to program some sort of integrating algorithm which sets the controlregister according to the temperature : probably exists already :) )

I tried the pwm on the 5V fan which fits the orangepi enclosure: there is a underlimit (the motor will not start).

Booting the orangepi with the middle pin attached to a mosfet, could stall the bootprocess.

(in that case try to disable [uart0])
 

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.