Closed klyatskin closed 3 years ago
Interrupt-related code requires better skills and experience and it's better to use only and only if i's absolutely necessary.
Don't use too fast 10uS timer interrupt.
You also have to test using some of the examples first, to fully understand what they're doing before modifying to fit your purpose.
Start from ISR_16_Timers_Array example, then moving on gradually.
I don't want to spend anytime on this issue as it's not the library issue.
Good Luck,
Good morning,
This sample code for test blinking works but the higher frequency it has the lower accuracy is reached for the blink period. I used 10us just to illustrate that while the code works the blinking period is about doubled from expected.
What I need is 150us frequency for 50% load pwm. Can I do it accurately through the interrupt? Is there any better way to chat with you?
Thank you anyway for the library. It works well for me with other projects. -- Konstantin
On Mon, Jul 19, 2021 at 11:09 AM Khoi Hoang @.***> wrote:
Interrupt-related code requires better skills and experience and it's better to use only and only if i's absolutely necessary.
Don't use too fast 10uS timer interrupt.
You also have to test using some of the examples first, to fully understand what they're doing before modifying to fit your purpose.
Start from ISR_16_Timers_Array example https://github.com/khoih-prog/NRF52_MBED_TimerInterrupt/tree/main/examples/ISR_16_Timers_Array, then moving on gradually.
I don't want to spend anytime on this issue as it's not the library issue.
Good Luck,
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/khoih-prog/NRF52_MBED_TimerInterrupt/issues/4#issuecomment-882627753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMJPTIA4M33JUZSTRUIMGTTYQ53NANCNFSM5AS7JRQA .
Glad to know that it's somehow helpful to you and you're very welcome.
What I need is 150us frequency for 50% load pwm.
You have to write the code yourself or use any PWM library working with MBED Nano-33-BLE. If there is no ready-made library, just port any PWM one to NRF52 MBED platform.
It all depends on your code (using how many MCU cycles, etc. ) and the core.
Also don't use time-consuming ISR_Timer.setInterval()
which is designed for slow-pacing jobs.
Is there any better way to chat with you?
Sorry, I won't do this. You're on your own
For some reason LED_PWR blink are about twice as slow... onTimer1s works as expected.