Skip to content
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

Fixing random mute/unmute on certain Arduino's (Tested Arduino Nano U… #250

Merged
merged 1 commit into from
Jun 12, 2021

Conversation

acekrystal
Copy link
Contributor

…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 apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

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.

  • Requested changes are in a branch
  • Compiled and tested requested changes on target hardware (PC, device)
  • Updated the documentation, if necessary
  • Updated the LICENSES file, if necessary
  • Reviewed the guidelines for contributing to this repository

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.

…SB-C)

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.
@XScorpion2 XScorpion2 merged commit 3a887a3 into t3knomanzer:master Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants