Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

setInterval on a running timer results in a period significantly longer than the specified period #17

@stripwax

Description

@stripwax

Describe the bug

Changing the timer period incurs additional unexpected delays, resulting in actual period being longer than the specified period (for the period in which it was changed). Behaviour observed with TC3 on SAMD21.

Steps to Reproduce

From inside the ISR, call setInterval . In my usecase, my ISR is toggling an output bit and then calling setInterval (for a variable-period output signal). By measuring the output, you can determine the "actual" period length or frequency.

Expected behavior

Expect the period of a square wave output to be equal (or very very close) to what was specified in the call to setInterval

Actual behavior

The period of the square wave is approximately 100us longer than the specified period.

Information

Seeeduino Xiao M0 (SAMD21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions