We're no longer updating This wiki!!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:c2_hardware_pwm [2016/02/26 11:18]
ck.kim created
en:c2_hardware_pwm [2017/01/31 19:10] (current)
odroid [freq0]
Line 2: Line 2:
 ---- ----
  
-**ODROID-C1** Has two possible PWM ports. One port is shared with SPI.+**ODROID-C2** Has two possible PWM ports.
  
-Starting from [[C1_Ubuntu_release_note_v1.1|Ubuntu Release (v1.1)]] or a kernel update performed on 2015-01-01 or later includes the PWM support.+Starting from [[c2_ubuntu_release_note_v1.1|Ubuntu Release (v1.1)]] or a kernel update performed on 2016-02-26 or later includes the PWM support.
  
  
 ===== Usage ===== ===== Usage =====
-For pin position, numbers and names, please refer to the pinmap [[http://​odroid.com/​dokuwiki/​doku.php?​id=en:​c1_hardware#​expansion_connectors|Expansion Connector]] +For pin position, numbers and names, please refer to the pinmap [[http://​odroid.com/​dokuwiki/​doku.php?​id=en:​c2_hardware#​expansion_connectors|Expansion Connector]] 
-=== Option 1: Single PWM and SPI ===+=== Option 1: Single PWM ===
 The code below loads the PWM module with a single PWM and the PWM controller module. The code below loads the PWM module with a single PWM and the PWM controller module.
  
Line 15: Line 15:
  
 <​code>​ <​code>​
-sudo modprobe pwm-meson ​npwm=1+sudo modprobe pwm-meson
 sudo modprobe pwm-ctrl sudo modprobe pwm-ctrl
 </​code>​ </​code>​
  
  
-=== Option 2: Two PWM and **NO-SPI** ​===+=== Option 2: Two PWMs ===
 //**PWM PINS:**// //**PWM PINS:**//
  
Line 32: Line 32:
 </​code>​ </​code>​
  
 +<WRAP left round important 100%>
 +If you are using TWO pwm setup, PWM1 & SPI can not be used simultaneously.\\
 +Because GPIOX_7(pin19) has two function spi_mosi & pwm.
 +</​WRAP>​
  
 ==== Examples of usage ==== ==== Examples of usage ====
 You can control this pwm via simple sysfs entries. You can control this pwm via simple sysfs entries.
  
-On **/​sys/​devices/​platform/​pwm-ctrl** You'll find the following files:+On **/​sys/​devices/​platform/​pwm-ctrl/** You'll find the following files:
  
 ==== duty0 ==== ==== duty0 ====
Line 59: Line 63:
 enable1, freq1, duty1 enable1, freq1, duty1
 </​WRAP>​ </​WRAP>​
 +
 +==== How to access the PWM port in C language ====
 +
 +[[http://​forum.odroid.com/​viewtopic.php?​f=141&​t=25563#​p177696|Example code by paulcrawford ]]
 +
 +
en/c2_hardware_pwm.1456454888.txt.gz · Last modified: 2016/02/26 11:18 by ck.kim
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0