tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PWM and user space API





On May 28, 2018, at 2:43 PM, Jason Thorpe <thorpej%me.com@localhost> wrote:

The PCA9685 also doesn’t have a variable clock UNLESS it’s driven by an external clock source, in which case a pre-scaler value can be applied (though, I’m not 100% certain on this — need to re-read the data sheet).  So having to configure the period as the current API requires is kind of inconvenient.

Ah, I did, in fact, mis-read the data sheet.

The PWM period is set by the following formula:

pre_scale = round((clock / (4096 * period)) - 1;

…regardless of internal or external clock.

So, my objection to having to set the period is hereby withdrawn :-)

-- thorpej



Home | Main Index | Thread Index | Old Index