Open Ch3fk0ch88 opened 6 years ago
The README gives some explanation: https://practicingruby.com/articles/tricks-for-working-with-text-and-files but it seems a bit outdated.
For 25kHz, you will need a period of 40us. If you change CYCLE_TIME_US
in the source code to 4 instead of 1000 you should get a 25kHz PWM. Be aware however that you will only have 4 steps to adjust the duty rate of the PWM, roughly: 25%, 50%, 75%, 100%.
To improve this, you can reduce SAMPLE_US
and set it to 2us (or maybe even 1us) and you will get 40us/2us = 20 (or 40) steps for your PWM.
Let me know how that works for you!
After the changes in the code, the startup code shows:
pi@raspberrypi:~/pi-blaster $ sudo ./pi-blaster -D
MBox Board Revision: 0x10
DMA Channels Info: 0x7f35, using DMA Channel: 14
Using hardware: PWM
Number of channels: 32
PWM frequency: 25000 Hz
PWM steps: 20
Maximum period (100 %): 40us
Minimum period (5.000%): 2us
DMA Base: 0x20007000
Initialised, Reading /dev/pi-blaster.
I will try to hook up a oscilloscope and confirm everything still works but it should ;)
So, i tried it but i get no PWM Signal^^ Have to make a resetup, seems that something is worng.
So, i tested it again but i dont get a signal with the changed pi-blaster.c
Yes I have done some tests too and I it does not work when there are less than 200 samples (cycles period divided by time unit).
So right now the highest frequency available is 1/200us so 5kHz.
I am pretty sure it’s a bug in pi-blaster somewhere but I have not figured where yet.
On Fri, Oct 5, 2018 at 11:00 PM Ch3fk0ch88 notifications@github.com wrote:
So, i tested it again but i dont get a signal with the changed pi-blaster.c
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/sarfata/pi-blaster/issues/107#issuecomment-427497429, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvi_TLcK4Wm64r9cirardR8hgI_nY0rks5uh8hngaJpZM4XIp_2 .
Ok, Let me know when u find a solution.
Thanks
Hello, It's been a while, have you found the bug by now?
No sorry. I have not been working on this project.
I am also having this issue, although the fans I'm controlling appear to work at 5khz their spec sheet says 21k to 28k. I have also had a play and confirmed the minimum 200 samples is still the issue.
Would be great if someone could do a PR to fix this. I would gladly review and merge it.
Hy, on which way i can cahnge the PWM Frequency to 25kHz? I found nothing in the internet....
Thanks