Keyboard Shortcuts
Likes
Search
doTuning Code Question
In doTuning where the pot hits the low stop, ??? baseTune = baseTune - 10000l; ??? frequency = baseTune; This makes sense, drop the center of the tuning range by 10KHz. Where the pot hits the top stop, ??? baseTune = baseTune + 10000l;????????????? // ok ??? frequency = baseTune + 50000l;???????????? // Huh? The extra 50KHz makes no sense. James |
baseTune is the frequency you get when the pot is rotated to the bottom of the linear tuning region. ?When the pot is rotated to the top of the linear tuning region, that frequency is 50khz above baseTune. On Tue, Mar 14, 2017 at 11:35 am, <jmlynesjr@...> wrote:
? |
Ah yes Jerry you're right. I was too quick.
toggle quoted message
Show quoted text
When I remove the 50 kHz it seems to work ok while you are at the end of the pot. But when your return back to the linear region then suddenly the frequency jumps up by 50 kHz. So yes, the extra 50 kHz is indeed necessary! 73, Allard PE1NWL On Tue, March 14, 2017 19:43, Jerry Gaffke via Groups.Io wrote:
baseTune is the frequency you get when the pot is rotated to the bottom of |
Thank you for your comments. I'm still getting my head around exactly how doTuning works. |
There's plenty of changes that need to be made to the Raduino sketch. ?But those are not changes I'd find compelling: Tuning position within the current 50khz range at power up may as well be wherever the pot happens to be set. Having ? ?knob!=old_knob ? ?on first pass is good, the Si5351 gets an initial frequency loaded? Having ? If (knob!=old_knob) ? as an outside conditional would avoid executing some code, but that doesn't buy more than a few microseconds. ? It would be better programming practice to initialize dir_knob to either 1 or 0, but in this case it would make no noticeable difference to the user. Here's a thread you might check out if you are interested in taking an axe to doTuning(): ? ?/g/BITX20/message/23362? Also read this blog post: ? And Jack's programming style kibitzing: ? ?/g/BITX20/message/22358 Jerry, KE7ER On Wed, Mar 15, 2017 at 03:29 pm, <jmlynesjr@...> wrote:
At POR the pot could be in any position therefore knob can be anything from 0-1000 counts. Odds are the pot wasn't centered therefore the tuneup range will not be equal to the tunedown range. If you want the ranges to be equal, a routine could be added to setup() to center the pot at POR. The knob position at POR is initially equated to baseTune = 7100000L; //7100 KHz.
? |