¿ªÔÆÌåÓý

Changing frequency display


 

So I have the BitX40 all running (not in a case yet). ?I also have the arduino firmware downloaded and want to make a minor change in the way the frequency is displayed. ?Instead of it being displayed as 7.XXXX I would like it to display 7XXX.X. ?Can someone help me on what changes need to be made in the programming in order to accommodate this. ?I know this is pretty superficial, but I think it would make more sense in seeing the display this way.

Thanks in advance


Jack Purdum
 

In the updateDisplay() function, you'll find this line:

? ? sprintf(c, "%s:%.2s.%.4s", vfoActive == VFO_A ? "A" : "B" , b, ?b+2);

This line needs to be replaced with the lines marked in yellow. I've written it as a short test program, since my B40 is still in pieces.

void setup() {
? // put your setup code here, to run once:
? Serial.begin(9600);
? char c[20];
? char b[20];
? long freq = 7123456L;
? int VFO_A = 1, vfoActive = 1;

// ?sprintf(c, "%s:%.2s.%.4s", vfoActive == VFO_A ? "A" : "B" , b, ?b+2);
? ltoa(frequency, b, DEC);
? if (vfoActive == VFO_A) {
? ? strcpy(c, "A:");
? } else {
? ? strcpy(c, "B:");
? }
? strncat(c, b, 4);
? strcat(c, ".");
? strcat(c, &b[4]);?
??
? Serial.println(c);
??
}

void loop() {
}

Jack, W8TEE


From: Tim - K7PTM <tamccain@...>
To: [email protected]
Sent: Thursday, March 16, 2017 12:03 AM
Subject: [BITX20] Changing frequency display

So I have the BitX40 all running (not in a case yet). ?I also have the arduino firmware downloaded and want to make a minor change in the way the frequency is displayed. ?Instead of it being displayed as 7.XXXX I would like it to display 7XXX.X. ?Can someone help me on what changes need to be made in the programming in order to accommodate this. ?I know this is pretty superficial, but I think it would make more sense in seeing the display this way.
Thanks in advance



 

Jack

When is your BITX going to be put back together? Seems like it has been in bits for a long time.

I'll give this a try too.

Thanks for the posting.

Randy, K7AGE


On Thu, Mar 16, 2017 at 7:26 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
In the updateDisplay() function, you'll find this line:

? ? sprintf(c, "%s:%.2s.%.4s", vfoActive == VFO_A ? "A" : "B" , b, ?b+2);

This line needs to be replaced with the lines marked in yellow. I've written it as a short test program, since my B40 is still in pieces.

void setup() {
? // put your setup code here, to run once:
? Serial.begin(9600);
? char c[20];
? char b[20];
? long freq = 7123456L;
? int VFO_A = 1, vfoActive = 1;

// ?sprintf(c, "%s:%.2s.%.4s", vfoActive == VFO_A ? "A" : "B" , b, ?b+2);
? ltoa(frequency, b, DEC);
? if (vfoActive == VFO_A) {
? ? strcpy(c, "A:");
? } else {
? ? strcpy(c, "B:");
? }
? strncat(c, b, 4);
? strcat(c, ".");
? strcat(c, &b[4]);?
??
? Serial.println(c);
??
}

void loop() {
}

Jack, W8TEE

From: Tim - K7PTM <tamccain@...>
To: [email protected]
Sent: Thursday, March 16, 2017 12:03 AM
Subject: [BITX20] Changing frequency display

So I have the BitX40 all running (not in a case yet).? I also have the arduino firmware downloaded and want to make a minor change in the way the frequency is displayed.? Instead of it being displayed as 7.XXXX I would like it to display 7XXX.X.? Can someone help me on what changes need to be made in the programming in order to accommodate this.? I know this is pretty superficial, but I think it would make more sense in seeing the display this way.
Thanks in advance




 

Just a clarification, am I simply adding the lines in yellow, or am I deleting the line that starts with sprintf and replacing that with the lines in yellow?


Jack Purdum
 

It's going to be in pieces until I put it back together, which means adding an (RF) AGC, input voltage pick-off, "true" CW capability, a capacitive touch keyer, and 2.4" TFT color display. The latest possible date is mid-May, hopefully before that. Meanwhile, I'm trying to contribute on the software end of things even if I can't test it. I thought some help is better than no help.

Jack, W8TEE



From: Randy Hall <listk7age@...>
To: [email protected]
Sent: Thursday, March 16, 2017 11:41 AM
Subject: Re: [BITX20] Changing frequency display

Jack

When is your BITX going to be put back together? Seems like it has been in bits for a long time.

I'll give this a try too.

Thanks for the posting.

Randy, K7AGE


On Thu, Mar 16, 2017 at 7:26 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
In the updateDisplay() function, you'll find this line:

? ? sprintf(c, "%s:%.2s.%.4s", vfoActive == VFO_A ? "A" : "B" , b, ?b+2);

This line needs to be replaced with the lines marked in yellow. I've written it as a short test program, since my B40 is still in pieces.

void setup() {
? // put your setup code here, to run once:
? Serial.begin(9600);
? char c[20];
? char b[20];
? long freq = 7123456L;
? int VFO_A = 1, vfoActive = 1;

// ?sprintf(c, "%s:%.2s.%.4s", vfoActive == VFO_A ? "A" : "B" , b, ?b+2);
? ltoa(frequency, b, DEC);
? if (vfoActive == VFO_A) {
? ? strcpy(c, "A:");
? } else {
? ? strcpy(c, "B:");
? }
? strncat(c, b, 4);
? strcat(c, ".");
? strcat(c, &b[4]);?
??
? Serial.println(c);
??
}

void loop() {
}

Jack, W8TEE

From: Tim - K7PTM <tamccain@...>
To: [email protected]
Sent: Thursday, March 16, 2017 12:03 AM
Subject: [BITX20] Changing frequency display

So I have the BitX40 all running (not in a case yet).? I also have the arduino firmware downloaded and want to make a minor change in the way the frequency is displayed.? Instead of it being displayed as 7.XXXX I would like it to display 7XXX.X.? Can someone help me on what changes need to be made in the programming in order to accommodate this.? I know this is pretty superficial, but I think it would make more sense in seeing the display this way.
Thanks in advance






Jack Purdum
 

When you see comment characters ("//") in front of a statement line, that means it's no longer in the program.

Jack, W8TEE



From: Tim - K7PTM <tamccain@...>
To: [email protected]
Sent: Thursday, March 16, 2017 2:43 PM
Subject: Re: [BITX20] Changing frequency display

Just a clarification, am I simply adding the lines in yellow, or am I deleting the line that starts with sprintf and replacing that with the lines in yellow?



 

Jack

Sounds like you will have a maxed out BITX40.

I made the code changes. Seems to work. I only had the Raduino?powered up for the test.

Thanks

Randy, K7AGE

On Thu, Mar 16, 2017 at 11:50 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
When you see comment characters ("//") in front of a statement line, that means it's no longer in the program.

Jack, W8TEE



From: Tim - K7PTM <tamccain@...>
To: [email protected]
Sent: Thursday, March 16, 2017 2:43 PM
Subject: Re: [BITX20] Changing frequency display

Just a clarification, am I simply adding the lines in yellow, or am I deleting the line that starts with sprintf and replacing that with the lines in yellow?




Jack Purdum
 

Looks good!!

Jack, W8TEE



From: Randy Hall <listk7age@...>
To: [email protected]
Sent: Thursday, March 16, 2017 3:42 PM
Subject: Re: [BITX20] Changing frequency display

Jack

Sounds like you will have a maxed out BITX40.

I made the code changes. Seems to work. I only had the Raduino?powered up for the test.

Thanks

Randy, K7AGE

On Thu, Mar 16, 2017 at 11:50 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
When you see comment characters ("//") in front of a statement line, that means it's no longer in the program.

Jack, W8TEE



From: Tim - K7PTM <tamccain@...>
To: [email protected]
Sent: Thursday, March 16, 2017 2:43 PM
Subject: Re: [BITX20] Changing frequency display

Just a clarification, am I simply adding the lines in yellow, or am I deleting the line that starts with sprintf and replacing that with the lines in yellow?






College Professor Simon Thompson
 

¿ªÔÆÌåÓý

That is one slick rig!

On Mar 16, 2017, at 1:39 PM, Jack Purdum via Groups.Io <econjack@...> wrote:

Looks good!!

Jack, W8TEE



From:?Randy Hall <listk7age@...>
To:?[email protected]?
Sent:?Thursday, March 16, 2017 3:42 PM
Subject:?Re: [BITX20] Changing frequency display

Jack

Sounds like you will have a maxed out BITX40.

I made the code changes. Seems to work. I only had the Raduino?powered up for the test.

Thanks

Randy, K7AGE

On Thu, Mar 16, 2017 at 11:50 AM, Jack Purdum via Groups.Io?<econjack@...>?wrote:
When you see comment characters ("//") in front of a statement line, that means it's no longer in the program.

Jack, W8TEE



From:?Tim - K7PTM <tamccain@...>
To:?[email protected]?
Sent:?Thursday, March 16, 2017 2:43 PM
Subject:?Re: [BITX20] Changing frequency display

Just a clarification, am I simply adding the lines in yellow, or am I deleting the line that starts with sprintf and replacing that with the lines in yellow?







 

Your code seems to work beautifully. ?Thank you. ?And for some reason I didn't even realize the double slashes there when I read through it. ?Possibly because I was reading it on my phone at the time. ?Anyway, thanks again. ?

Now on to the next modification - getting a 10 turn pot to cover the whole band and not just 50khz. ?


 

I am not sure that would be possible, as the ultimate frequency step resolution is determined by the A/D input - 1024 steps maximum. The only way to cover a wider range would be to change the step size per A/D bit, but then you'd lose the fine frequency resolution. One thing to consider, if an extra A/D input is available, would be to have a "fine tuning" control, where the main tuning would be set up for, say, 1KHz per A/D bit. That would give you an approximate 1MHz tuning range. The "fine tuning" pot would change at a 100 Hz rate, giving you the finer control. I think that would be very doable, assuming a spare A/D line is available.
Dave, N6AFV


 

Another idea to increase the frequency step resolution would be to use "oversampling".
The nano's ADC has a 10-bit precision, this gives a range of 0-1023 steps for 50kHz. If we want to cover 200 kHz (4x more), but keep the same step size, then we would need two extra bits of resolution.
For every n extra bits of resolution that we want, we have to take 4^n samples at the base 10-bit precision. Then calculate the average of those 4^n samples.
So theoretically we could take 4^2=16 samples and average them.
For a range of 400kHz we would need 3 extra bits, so we would need to take 4^3= 32 samples and average the 32 measurements.
The expense of this approach however is that it would slow down the tuning system by (at least) 16 or 32 times. I have never tried it and I don't know how much practical effect this would have to the user/operator.

73, Allard PE1NWL


 

Sorry, calculation error:

For a range of 400kHz we would need 3 extra bits, so we would need to take 4^3= 64 samples and average the 64 measurements.
The expense of this approach however is that it would slow down the tuning system by (at least) 16 or 64 times.


Michael Davis
 

I am about to make a tuning mod. I will add a 27-50 ohm resistor in series to each side of the tuning pot (yellow and green) That will prevent the pot from fast tuning at either end of travel. I will add 2 momentary buttons from the pot. One violet to yellow, the other violet to green. If my understanding of the tuning method is correct, this will exclude the control from doing anything but changing frequency in its normal range. When I want to step up, just push the U button, down press the D button, essentially having a sort of band range control over the desired frequency. I also plan on using a 10 turn, or a 3 turn 10k linear pot. Obviously using a multi turn pot makes the button mod a real necessity. No more getting close to the end of pot tuning travel then "ooops' the frequency starts taking off. Thoughts?

Sent from Mike's iPad WA1MAD


Jack Purdum
 

Some of these arguments confirm why I use a rotary encoder for tuning and menu selection. I have discussed my Fast Tune method here using the encoder which changes the frequency increment automatically when you start turning the encoder at a faster (user-defined) rate. This allows you to make large frequency changes without consciously changing the tuning rate. As you approach the desired frequency and slow your "turn rate" on the encoder, the increment automatically drops back to the default "fine-tuning" rate. All of the Fast Tune parameters can be set to suit your specific taste. The encoder is a cheap KY-040 with builtin switch which costs about a dollar. Farhan's tuning is very clever and doesn't require interrupts, which may be an advantage, depending on whatever other features you're adding. Fast Tune does use the Nano timer interrupts, but the code's pretty easy to understand. (See:?QRP Quarterly, April, 2016.)?


Jack, W8TEE


 

Adding momentary switches to both ends of the potentiometer would be a simple and frugal alternative to holding the pot at either 0 or 10k ohms. Another approach would be to use a rotary encoder and Jack's code. Why does anyone want greater resolution on SSB? Or is it just an exercise in programming for the fun of it?
Confused in Illinois


 

¿ªÔÆÌåÓý

Good afternoon Michael,

?

Much easier to do it in the sketch. With your method the switch has to be a break before make or you stand a chance of creating a short if the pot is at the +5 volt end and you simply push the ground end switch shorting the +5 to ground and letting all the smoke out of the 5 volt regulator.

I have mine setup to use a second pot to select the step size and can select 1, 10, 100, 1000 or 10000 Hz steps. This could also be done with a button switch to step through the various steps.

For some ideas look at Marcus's sketch. (A redo of his QEX article). He has some great ideas I have stolen. Mine has a GPS module attached and displays Time and Grid square as well as counting the oscillator during the one second GPS signal and automatically correcting the Si5153. $20 for a GPS module and adding 4 wires. I am looking at removing the pots and going with a rotary encoder and using the switch on the encoder to select step size.

I am not a programmer, but have become adept at swiping code sections of other people's sketches.

?

V/R??????????????????????????????????????????????????????????????????????????????????????

?

Fred W4JLE

?

?

?

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Michael Davis
Sent: Friday, March 17, 2017 9:23 AM
To: [email protected]
Subject: Re: [BITX20] Changing frequency display

?

I am about to make a tuning mod. I will add a 27-50 ohm resistor in series to each side of the tuning pot (yellow and green) That will prevent the pot from fast tuning at either end of travel. I will add 2 momentary buttons from the pot. One violet to yellow, the other violet to green. If my understanding of the tuning method is correct, this will exclude the control from doing anything but changing frequency in its normal range. When I want to step up, just push the U button, down press the D button, essentially having a sort of band range control over the desired frequency. I also plan on using a 10 turn, or a 3 turn 10k linear pot. Obviously using a multi turn pot makes the button mod a real necessity. No more getting close to the end of pot tuning travel then "ooops' the frequency starts taking off. Thoughts?

?

Sent from Mike's iPad WA1MAD

?

?

?

?

?

?


 

Craig,

you would need greater resolution when you want the tuning range to cover
the entire 40m band (instead of just a 50kHz segment).

currently:
single turn pot => 300 degrees rotation => 1000 steps =>0.3 degree/step
tuning range 50kHz => 50,000 kHz/1,000 steps = 50Hz/step

If we want a tuning range of 400 kHz (8x larger range), then the step size
would be 400Hz per step, which is too much (not enough precision).

It wouldn't help to just use a multiturn pot in this case because there
are still only 1,000 steps.

In order to keep the 50 Hz/step you would need 8,000 steps instead of
1,000, so eight times more steps. More steps means greater resolution. We
need 3 additional bits in order to have 8 times more steps.

For 3 additional bits we need to take 4^3=64 samples and take the average
of them (oversampling).

With 3 bits greater resolution, so 8,000 steps, in combination with a
10-turn pot, we would have 10 turns x 360 degrees / 8,000 steps = 0.45
degrees/step, which is 50% better than we currently have, while the tuning
range would span the entire 40m band!

But as I said I have never tried this - perhaps the tuning mechanism will
become too slow when it needs to take 64x more samples to determine the
pot position. Then a rotary encoder might indeed be easier and perhaps
cheaper too!

73, Allard PE1NWL


Michael Davis
 

Thanks Dr Fred. I have never messed with the raduino. Changing a sketch scares me. I do need to learn more about how to read the file/sketch save the file and modify the file.
Maybe I didn't explain my simple method very well. Part 1. A 25-50 ohm resistors in series with each outer potentiometer tab to green and another resistor in series to yellow. That would prevent the fast frequency change from engaging (I assume), since the center/violet would never "see" a direct (low or 0 ohms resistance) connection to either yellow or green raduino point. Part 2. A momentary push button switch from the center/purple pot tab to the raduino yellow wire and another to the raduino green wire. This would replicate the full turn, 0 ohms, of the pot CW or CCW. No ground to any of these connections (on purpose anyway) Simple? Work? I hope so. Part 3. A 3 turn or 10 turn pot? We'll see, stay tuned.

Sent from Mike's iPad WA1MAD


Michael Davis
 

This is what I tried to explain. Thanks to Dave Casler KE0OG. See

Sent from Mike's iPad WA1MAD