-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M300 set 3.5s duration limit #4846
M300 set 3.5s duration limit #4846
Conversation
9267193
to
b89c4dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choosing 4000ms might be a bit risky given that it exactly matches what the watchdog timer is specified to be running at. However, this may still be fine given the following:
- According to avrlibc, we set a timeout of 4 seconds, but that is not entirely correct. The datasheet specifies the watchdog crystal at 128KHz (that is 128000Hz) and the prescaler that we use to get 4s of timeout is /512K (that is 524288, not 512000!!), so the timeout is in fact set to 4.096s which is slightly bigger than the max beep time chosen. Still cutting it close at only ~96ms to spare. This obviously assumes the timer is running at the nominal speed, but that is never the case, which brings us to the next note I have.
- The watchdog timer speed is not only influenced by VCC voltage, but also by temperature. Here are the speeds of the timer under various conditions from the datasheet:
As can be seen there, the speed is always less than 128KHz, so we have a bit of extra margin at all times, so this may be good enough as a solution.
@leptun I tested on MK404 and at |
@leptun Which value would you prefer? 3500 3750? |
b89c4dd
to
c40af0c
Compare
All values in bytes. Δ Delta to base
|
3500 sounds good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on MK3S
Solves #2045
Post release tasks