Fixing random mute/unmute on certain Arduino's (Tested Arduino Nano U… #250
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…SB-C)
Issues
Description
Changing Baud Rate 115600 to 76800 as 115600 seems to be unflavored by the Atmega328P chip datasheet for common arduino configurations.
Types of changes
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
Fixing unexpected behavior of certain Arduino (clone?) boards where volume would glitch random value's or would randomly mute/unmute when turning the encoder.
This update might also increasing serial reliability for most other Atmega 328P boards.
Debugging the Glitches on an Arduino Nano (USB-C) clone it turns out either upping or lowering the boad rate to certain (common) rate would fix the problem. Digging into why this is the case revealed in many online conversations with the Atmega 328P datasheet backing this up that a baud rate of 115200 seems to be unfavored for the 328P chip in common configurations seen by Arduino boards. This baud rate matches difficult with the arduino configured 328P chip that it uses all correction/recovery potential in order to establish a working connection. When hardware deviations are added on top (for example a cheap 16Mhz Crystal running slightly slower) this could just tip over the correction capability and would result in faulty communications.
Looking at the datasheet the closest speed to 115200 with a great clock speed alignmet would be 76800 for a wide range of clock speed (8Mhz,12Mhz,16Mhz,18Mhz,20Mhz).
So the use of a 76800 baud rate leaves much more room to correct for cheap and unstable hardware situations.