CubieBoard Forum

Cubieboard itself => Hardware => Cubieboard v1 Hardware (A10 Based) => Topic started by: DrProton on May 02, 2013, 11:03:45 pm

Title: using PWM
Post by: DrProton on May 02, 2013, 11:03:45 pm
I got my cubieboard a few days ago.  I have been poking around a bit and getting some stuff working.

One subject I cannot find much information on is the hardware PWM pins.  How can I access these from within linux?

Title: Re: using PWM
Post by: vinifr on May 22, 2013, 08:49:53 pm
First, look here: http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20(2012-04-09,%20DECRYPTED).pdf (http://dl.linux-sunxi.org/A10/A10%20User%20Manual%20-%20v1.20%20(2012-04-09,%20DECRYPTED).pdf) chapter 9.

PWM driver: https://groups.google.com/forum/?fromgroups=#!searchin/linux-sunxi/pwm$20driver|sort:relevance/linux-sunxi/I81t60tLgcA/3z26wqyrPaAJ (https://groups.google.com/forum/?fromgroups=#!searchin/linux-sunxi/pwm$20driver|sort:relevance/linux-sunxi/I81t60tLgcA/3z26wqyrPaAJ)
Title: Re: using PWM
Post by: Dariush on May 25, 2013, 12:58:20 pm
What should be written in script.bin file for corresponding pins?
Title: Re: using PWM
Post by: vinifr on May 26, 2013, 09:58:27 am
You need to select a pin and then configure the correct multiplexer: http://linux-sunxi.org/A10/PIO (http://linux-sunxi.org/A10/PIO)

Example: PB02 or PI03: both use MUX2

Note: This patch has not been applied, would be better to wait! ;)
Title: Re: using PWM
Post by: DrProton on June 21, 2013, 10:53:36 pm
I followed the link to the driver and was able to  get PWM going.  However there seems to be a conflict somewhere.  Once I start fiddling with PWM I get a lot of kernel messages related to I2C transfer failures.

[  521.040000] i2c-0, xfer timeout
[  521.040000] axp_mfd 0-0034: failed reading from 0x56
[  526.050000] i2c-0, xfer timeout
[  526.050000] axp_mfd 0-0034: failed reading from 0x78
[  531.060000] i2c-0, xfer timeout
[  531.060000] axp_mfd 0-0034: failed reading from 0x5e
[  536.070000] i2c-0, xfer timeout
[  536.070000] axp_mfd 0-0034: failed reading at 0xb9
[  541.080000] i2c-0, xfer timeout
[  541.080000] axp_mfd 0-0034: failed reading at 0x30

Any idea where these are coming from and how to fix it?
Title: Re: using PWM
Post by: vinifr on July 15, 2013, 08:56:19 am
Do you applied the patch yourself? Which pins are you using? Look for conflicts: http://linux-sunxi.org/A10/PIO (http://linux-sunxi.org/A10/PIO)