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

Tone implementation #108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RedRussianBear
Copy link

Implemented Tone functionality for SAM3X/Due using TC5.

@DesperateProgrammer
Copy link

Looks solid.

Only one thing to consider:
There might be a little issue with EMV. Usually the rectangular signal will be filtered to reduce the high frequency parts of the steep rise/false edges. If Cutoff however is odd, the algorithm is introducing another frequency:
Example: MCK = 84MHz, Frequency = 440Hz (Musical Note A) -> Cutoff = 1491 -> Cuttoff/2 = 745
This creates two different widths for low and high phase. This actually generates the mixed frequency of MCK/128/(745*2) and MCK/128/1491 you will see a radiation of the frequency difference (MCK/128/1) in EMV measurements.

Surely the jitter due to the interrupt is flattening the EMV peek. But it will be measureable and might also interfere with some switching regulators operating in the same range.

This could be avoided with same or better frequency accuracy, If you decrease the prescaler to /32 and mask out the LSB in cutoff, so that cutoff value is never odd and the low and high times are equal.

@RedRussianBear
Copy link
Author

Thanks for pointing that out, I would have never realized! I just got around to fixing that issue, hopefully all's good now.

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
All committers have signed the CLA.

@RedRussianBear
Copy link
Author

Hi, is there anything else I need to do to get this PR accepted?

@jgromes
Copy link

jgromes commented Jun 23, 2021

@RedRussianBear pray to some elder deity, possibly - this PR has been blocking one issue in my project for half a year now, which is very frustrating.

@cmaglie (or anyone else with the permissions) can this merged, or does it require some changes? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants