Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWM: mraa limits a period supported by a kernel driver. #337

Open
xbolshe opened this issue Oct 25, 2015 · 5 comments
Open

PWM: mraa limits a period supported by a kernel driver. #337

xbolshe opened this issue Oct 25, 2015 · 5 comments

Comments

@xbolshe
Copy link
Contributor

xbolshe commented Oct 25, 2015

mraa has a dedicated limitation of period like b->pwm_max_period definded for a board.
Actually my Galileo Gen1 board supports a period up to 690880 us (or even more, this is a possibility of cy8c9540a). But I cannot select it. I guess only a kernel driver may limit a period, not mraa.

pwmlimit

@arfoll
Copy link
Contributor

arfoll commented Oct 25, 2015

Is this using the official 3.8.x kernel? Weird maybe the limit set in the board config is just wrong, can you verify you can actually set that? If you can I have no issues with raising the max.

@xbolshe
Copy link
Contributor Author

xbolshe commented Oct 25, 2015

I use my custom kernel 3.19.2, where I have changed cy8c9540a driver. And I got 1...690880 us.
Official Intel kernels like 3.8.7 and 3.14.23 for Galileo Gen1 board support only a narrow period range like 1...7968 us (do not know why, while cy8c9540a allows to make "690880 us" support easily).

Here is my test:

osc2

osc1

@xbolshe
Copy link
Contributor Author

xbolshe commented Oct 25, 2015

May be it is better to provide information about period limitation in the documentation as well as possible discrete values of the period. Need to note that Galileo Gen1 board does not support any period generation. It supports only limited discrete periods. When user enters some period, a nearest possible period is selected.

@Mark-van-der-Pol
Copy link
Contributor

On the MinnowBoard Turbot, the kernel driver through the filesystem sys/class/pwm interface, limits the max period to more than the MRAA Max says.

However, if it is set to more than 5230000, the PWM simply doesn't run.
Also, observing on a scope, the actual period seems to be off by 2x

Looking into this further.

|\/ark

@arfoll
Copy link
Contributor

arfoll commented Dec 30, 2017

Curious, maybe it's been tweaked again. Typically our max is really the observable max we see on our scopes but on minnowboard I think we trusted what was told to us by our colleagues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants