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

Speed up acquisition time by removing multiple delay() calls... #9

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

Conversation

etchorner
Copy link

@etchorner etchorner commented Jan 31, 2017

Removed all delay() calls, as the AD9850 DDS has microscopic settling time for frequency changes (~43ns) and serial communications (~30ns). Further, the ADCs on the Pro Micro acquisition time is only 13 - 25 µs, so there should be no need for any delay() calls.

Proposed changes reduce acquisition time for a 1-30 MHz scan from 11.74 seconds to 1.65 seconds or less. Reduces code size 142 bytes.

related to #8

Removed all delay() calls, as the AD9850 DDS has microscopic settling
time for frequency changes and serial communications. Changes reduce
acquisition time for a 1-30 MHz scan from 11.74 seconds to 1.65 seconds.
@dkozel dkozel self-requested a review January 31, 2017 05:08
@dkozel
Copy link
Contributor

dkozel commented Jan 31, 2017

Thanks for making the contribution! Based on a HR360 post I think the LCD delays might be required for stable operation, but I'll test it out and can merge at least the tuning related changes.

@etchorner
Copy link
Author

Mine seems to be rolling fine, but your mileage may vary and only testing will tell. I will add that if you look at the code for the LiquidCrystal library, it is full of calls to delayMicroseconds() to account for the slow LCD interfaces.

- added automated calibration routines to setup(). Measures the FWD/REV
ADC values when no input is appled to compensate for idle noise. These
offsets are subtracted from the later FWD/REV reads.
- added diode mismatch compensation values, empirically read at the ADC
when a shorted antenna port is being drive. The ratio of  measured value
(REV/FWD) is used to compensate the FWD value.
- The two compensation ratios (Gain and Diode) turned out to be
frequency dependent, requiring equations to determine the compenstation
ratio during the sweep (left in the mean value and linear methods of
compensation as comments).
- Changed display routines to provide a more readable output with fixed
sizes and scaling/
- Moved the ADC readings more stable by adding an averaging routing.
- Removed the "throwaway readings" routine, as the problem seems to have
solved itself.
- removed unused code and variables.
@etchorner
Copy link
Author

I didn't realize that my later edits to the local copy were going to show up here as commits in the pull request (warned you all I was a Git newbie). For the purposes of this pull request, I only want you to consider the first commit I offered, where I removed the delay() calls.

@dkozel
Copy link
Contributor

dkozel commented Feb 6, 2017

@etchorner no worries. I can easily separate them out. If you create a different branch for your own work then it won't be added to this pull request. Sorry it's taking a while to get this merged, didn't have much free time this weekend.

git checkout -b new_branch_name

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

Successfully merging this pull request may close these issues.

2 participants