Thank you so much for the fast reply. I'll try doing what you described. Thanks gain.
Rand



From: jumpnowdev <scott@jumpnowtek.com>
To: gumstix-users@lists.sourceforge.net
Sent: Monday, February 4, 2013 7:43 PM
Subject: Re: [Gumstix-users] changing the frequency of Scott Ellis pwm driver

There is a frequency parameter you can pass to the driver
when you load it, but it applies to all of the timers.

It's described in the README.

It's a trivial mod to do what you want, i.e. give each timer
their own frequency.

Here's what I'd do.

Add a new frequency variable to struct pwm_dev

struct pwm_dev {
    dev_t devt;
    struct cdev cdev;
    struct device *device;
    ...
+ int frequency;
};

Initialize it for each timer, maybe in pwm_init() but anywhere
as long as its before the pwm_set_frequency() call. Since you
know your frequencies, I'd just hard code them.

Then everywhere the current global frequency is used, use
your new pwm_dev.frequency instead. I think it's just
pwm_set_frequency() and pwm_set_servo_pulse() but I'd
check yourself.

FYI, the README is a little behind some recent changes to the
driver from Jemiah Aitch and Tobias Simon. Performance should
be improved using ioctl to change the timer settings at runtime.
The old file write() still works though.

Scott









--
View this message in context: http://gumstix.8.n6.nabble.com/changing-the-frequency-of-Scott-Ellis-pwm-driver-tp4966694p4966695.html
Sent from the Gumstix mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users