HamRadio360 / Antenna-Analyzer

K6BEZ Antenna Analyzer Build Project
33 stars 18 forks source link

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

Open etchorner opened 7 years ago

etchorner commented 7 years ago

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

dkozel commented 7 years ago

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 commented 7 years ago

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.

etchorner commented 7 years ago

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 commented 7 years ago

@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