-
Notifications
You must be signed in to change notification settings - Fork 59
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
DDS Support for Arduino Zero (and its built-in DAC) #15
base: master
Are you sure you want to change the base?
Conversation
- Added a 10-bit sine table, probably wasteful considering its stored in 16-bit integers. - Added "DDS_MAX_COMPARATOR" and "DDS_MAX_ACCUMULATOR" macros to hide some math and imrpove readability. - Simplified calcFrequency and made it work for arbirary frequencies (with/without default refclk) - Simplified getDutyCycle(). I think its more understandable now, and works for various combinations of accumulator size and lookup table size. Tested on both an Arduino Zero and an Arduino UNO. Seems to work, but YMMV.
I'm considering this "done" for now, until I get a real HamShield to play with. Even if you don't take these changes, there are a few good ideas (I think) that you may want to incorporate into your main branch. |
Thanks! This is really cool! I will have Stephen and Nigel take a look at We can get any of the bugs sorted out once you get your HamShield. On Mon, Aug 17, 2015 at 2:31 PM, jake-b [email protected] wrote:
|
NOTE: this sample won't really work for the HamShield ont he Ardiuno Zero as it will Besides the logic voltage issue, it will be playing its tones out of AO, rather than D3 or D11. Hook up your oscilloscope to A0 to see the waveform.
Hello Jake, |
@spaceneedle, what's the current plan for merging this commit to support the Zero? Have you or anyone else validated it still works with the shipping version of HamShield? |
Has anyone had a chance to test this? I don't have access to a Zero board, so I'm unable to verify functionality. |
This is a very rough draft of DDS support for the Arduino Zero. I still have more work to do, but it is working pretty well. You can see the oscilloscope output from the code running on a Zero here:
A nice smooth wave (more or less) without any filtering, since it is a DAC rather than PWM.
There are some limiting factors to using HamShield (as best I can gather from public info):
I'm going to try a "DigiX level shifter shield" between the HamShield and the Zero to deal with the 3.3v issue. The shield also lets you route the SDA/SCL lines to the A4/A5 location. I can probably cut/solder around the A0/D3 issue as well.
This is all out-of-scope for the Kickstarter, but I would love to see a "HamShield 2.0" that is more compatible with Leonardo, Due, and Zero.
I'll continue to work on this Zero DDS code to fix a few omissions and bugs.