-
Notifications
You must be signed in to change notification settings - Fork 2
DutyCycle to be updated at the end current PWM period #2
Comments
HI @ggmichael I'll publish a new release to add this enhancement within half an hour for you to test the new feature. Be ready. Regards, |
Hi @ggmichael The new ESP8266_PWM releases v1.2.2 has just been published. Your contribution is noted in Contributions and Thanks. Please test and verify the new feature is supported and working OK now. The library is better and better everyday, thanks to contributing users like you, who spot bugs, test and request enhancements. We, the library writers, normally can't never have enough time, knowledge and experience to know all the use-cases in the world to add the new features. Best Regards, Releases v1.2.2
|
### Releases v1.2.1 1. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2)
### Releases v1.2.1 1. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2)
### Releases v1.2.1 1. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2)
I can confirm that the new code gets rid of the 'glitch' on changing duty cycle - that's great - thanks. I think you're right that analogWrite() doesn't do this, but there's no harm in having a better implementation. (However, something is now causing the ESP8266 to reboot periodically - I have to check over my integration of the library) |
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 3. Add examples [SAMD21 multiFileProject](examples/SAMD21/multiFileProject) and [SAMD51 multiFileProject](examples/SAMD51/multiFileProject)to demo for multiple-file project 4. Improve accuracy by using `double`, instead of `uint32_t` for `dutycycle`, `period`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA` 7. Update examples accordingly 8. Update `Packages' Patches`
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 3. Add examples [multiFileProject](examples/multiFileProject) to demo for multiple-file project 4. Improve accuracy by using `double`, instead of `uint32_t` for `dutycycle`, `period`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 3. Add examples [multiFileProject](examples/multiFileProject) to demo for multiple-file project 4. Improve accuracy by using `double`, instead of `uint32_t` for `dutycycle`, `period`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Update examples accordingly
HI @ggmichael
If you still have that problem, I suggest you try these mods to see if it's any better
The reason is the ISR-based function I'm thinking, in future releases, about letting users optionally select |
Hi Khoi,
I got a previous version to work by back-integrating the main parts of your
new updates. I did use floats for the duty cycle instead of double (I think
double is more precision than you could ever need). The period remained
uint32_t (this also makes sense to me, since this is the actual count).
Frequency could also be a float, since it is always converted. So maybe
this is the reason. I'll try your new suggestions when I get a chance -
probably only next week.
…On Tue, 1 Feb 2022, 14:59 Khoi Hoang, ***@***.***> wrote:
HI @ggmichael <https://github.com/ggmichael>
However, something is now causing the ESP8266 to reboot periodically - I
have to check over my integration of the library
If you still have that problem, I suggest you try these mods to see if
it's any better
1. Increase ESP8266 clock to 160MHz from 80MHz, if not yet
2. Increase the HW_TIMER_INTERVAL_US from 20uS to higher, such as 30,
50, 100uS. For example
*ISR_Modify_PWM.ino*#L46
<https://github.com/khoih-prog/ESP8266_PWM/blob/main/examples/ISR_Modify_PWM/ISR_Modify_PWM.ino#L46>
#define HW_TIMER_INTERVAL_US 50L
The reason is the ISR-based function run() now *take more time to process*
(double accuracy, dutycycle check, etc.)
I'm thinking, in future releases, about letting users optionally select
double, float or uint32_t for dutycycle / frequency / period, depending
on the use-case.
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR5ZQ2XLYMJDCQALK3GE77LUY7RLBANCNFSM5NEVDMVQ>
.
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:
***@***.***>
|
I agree with you and will make Will have a new release within today. |
Hi @ggmichael Please test the new ESP8266_PWM releases v1.2.3 Releases v1.2.3
|
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
I confirm that update works, and also fixes the reboot problem. |
Glad to know it's working better now, thanks to your contribution anyway. |
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Add support to `MegaCoreX` core, including ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808 3. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 4. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 7. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Add support to `MegaCoreX` core, including ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808 3. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 4. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 7. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Add support to `MegaCoreX` core, including ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808 3. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 4. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 7. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Add support to `MegaCoreX` core, including ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808 3. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 4. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 5. Optimize library code by using `reference-passing` instead of `value-passing` 6. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 7. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Fix bug 7. Update examples accordingly 8. Update `Packages_Patches`
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Fix bug 7. Update examples accordingly 8. Update `Packages_Patches`
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly 7. Update `Packages_Patches`
### Releases v1.2.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`. Check [Change Duty Cycle #1](khoih-prog/ESP8266_PWM#1 (comment)) 3. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2) 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project 6. Update examples accordingly
Original post from @ggmichael in Change Duty Cycle #1
The text was updated successfully, but these errors were encountered: