Closed Gavin-Perry closed 2 years ago
HI @Gavin-Perry
You have to write a better and concise issue report. I won't spend time to go thru your rant, without proof, enough and correct info to test and duplicated.
Please follow and post the standard MRE so that anyone can duplicate without wasting time.
Also post the issue to the correct library or core. Separate the issue to many issues as necessary.
I have to close this and wait for anything better to act upon.
Khoi,
I apologize for the issue post on duty cycle appearing to be a rant. I posted it after a long frustrating day well after midnight and really should have read it over the next day before posting it. I thought I was covering all the requirements of an issue as I followed the outline given in the issue template. Ill check the MRE link in the future and be sure not to mix other issues into the post (especially since the git issue space is a public forum.
Upon rereading your Multi example I see that you are in fact using % for duty cycle. The issue is converting from double to uint16_t seems to be affecting the smoothness. I'll work on it some more and create a concise example that you can run.
THe second part is a suggestion that there be a simple SetPWMDC16bit routine (or whatever you would want to call it so that I can drop in my 16 bit duty cycle instead of converting to float and back.
Thanks again for the support and clarification about MRE. I owe you another cup of coffee. ;-)
Gavin
-- Gavin Perry, PhD Chief Technology Officer Meridian Electric Company 2392 Grissom Drive St Louis MO 63146 http://meridianlighting.com cell: 314 406-0697 http://voice.google.com/calls?a=nc,%2B13144060697
On Sun, Feb 20, 2022 at 11:35 PM Khoi Hoang @.***> wrote:
Closed #4 https://github.com/khoih-prog/RP2040_PWM/issues/4.
— Reply to this email directly, view it on GitHub https://github.com/khoih-prog/RP2040_PWM/issues/4#event-6108912672, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVR4PP4NDPYOEZM5WE3ITOLU4HFLFANCNFSM5O4ETJDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Hi @Gavin-Perry
I'm sorry if you feel offended. I really didn't mean so.
We're all in the hi-tech, not sales and used to speak not in diplomatic way to have fast and good results.
I'm inviting you into a private repo, where many experts, I handpicked, have been participating and we can discuss / support each other relating to many more hi-tech subjects, sometimes more personally and suitable than in this public repo.
Regards,
Describe the bug
Added in 1.0.5:
A clear and concise description of what the bug is. What are the units you are using for duty cycle? Normally with 16 but PWM you would just load a 16 bit count value and be done with it. It looks like you might be using float of 0.0 - 100.0% - Trying to be fast here why mess with floating point numbers? I tried both
Steps to Reproduce
Used your example PWM_Multi adding to the loop:
Also tried
Expected behavior
I'm looking for a smooth increase and then decrease in the duty cycle (and thus LED brightness) from 0 to 100% and back to 0
Actual behavior
Depending on which version I try I get some smooth action then big jumps in brightness (something is wrapping to zero at the wrong time). Even when it is working over some of the range it's flickering when it shouldn't (resetting the slice? IDK)
debug
set level to 3 don't get any reports One odd thing is that when I enable the Serial Monitor it always says (in orange at the top of Monitor pane): "Not Connected. Select a board and port to connect automatically" But then it works anyway. Took me a while to realize it's in a pane of the program window not a separate window as in 1.8 1.8 couldn't find the PIO.h file
Screenshots
I could send a video of the LED or scope traces of the PWM (Have to set up the o'scope)
Information
Arduino IDE 2.0.0 rc3 (also tried 1.8.15 but messed that up installing arduino-pico)
`RP2040-Zero from WaveShare
Contextual information Smooth deep dimming down to 1/65536 full 16 bit dimming (most commercial dimmers are 10%-100% and "best" e.g. DALI are still only 1:1000 i.e. 0.1% Eyes can see much better than that.
Simplest possible steps to reproduce Using PWM_Multi but removed array for frequence fixed freq = 2000; Loop changed to above code
Anything that might be relevant in your opinion, such as: Aspire 5 core i5 2.4GHz 20GB Ram; Windows 11 Home 21H2 - if that matters I'd like a simple to use library, the whole point of a library is to hide complexity so once the PMW slice has been set up there should be simple routines like
I've been reading the Pico hardware manual, it's dense, this machine is so powerful! I'm happy that you dug in and extracted a working PWM package, it just needs a little tweeking and documentation I think.
BTW another odd thing: After working for quite a while loading code after compile just fine. It quit loading and now requires unplugging and holding boot button every time. Is that because I'm using all the PIO?