Jump to content

OpiPC PWM on GPIO?


kennyevo

Recommended Posts

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!

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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])
 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines