Jump to content

Orange Pi Zero PWM


Denis Periša

Recommended Posts

 

There is /dev/pwm in nanopi.
 
nanopi@nanopim1:~$ ls /dev/p*
/dev/ppp  /dev/psaux  /dev/ptmx  /dev/pwm
 
 
A sample code is here.
 

 

I'm trying to understand how you get from point A to point Z via that matrix repository at Github.  

 

That repository is intended "Nanopi2/Fire/M2" devices, yet the Orange Pi Zero is an Arm H2 device.  Remember the orange pi zero is listed as the topic for this posting.   Is the Orange Pi Zero Arm H2 really a Nanopi2 / Fire or M2 device?  How do you know that? Are these things the same? (I'd refer to the readme.md sheet at the matrix repository, but alas, that doesn't exist... sigh.)

 

Orange Pi Zero = Arm H2 Quad-core Cortex-A7 1.2Ghz.

Raspberry Pi Zero =A Broadcom BCM2835 application processor with 1GHz ARM11 core

 

(Note: no offense intended here..  I'm struggling to understand how to address the pins on the Orange Pi Zero, and I'm more than confused here...  Any hints or links to help gain and understanding? Many thanks --Zip)

Link to comment
Share on other sites

yup. but I read somewhere that 4.9 kernel should have pwm support for h3/h2 devices.

It has the support, but it's not activated by default since hardware PWM is supported only on PA5 pin, which is used bt default serial console (UART0). So it requires some DT modifications which include moving default debug console to a different UART port.

Link to comment
Share on other sites

how about software pwm? found this code in another site:

 

#include <wiringPi.h>

int main () {
  wiringPiSetup();
  int t_on, t_off;
  int d, i;

  d= 100 ;

  t_on= 50 *d;
  t_off= 50 *( 100 -d);

  for (i= 10 ; i!= 0 ; i++) {
    digitalWrite( 1 , LOW);
    delayMicroseconds(t_on);
    digitalWrite( 1 , HIGH);
    delayMicroseconds(t_off);
  }
  return ( 0 );
}
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