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.
? |