¿ªÔÆÌåÓý

Date

Re: ND6T AGC implementation for uBIT-X

Vince Vielhaber
 

Ok, so Jerry doesn't write code the same way you do. Neither do I. Prolly why I didn't see anything wrong with it.

Vince.

On 05/06/2018 01:38 PM, Jack Purdum via Groups.Io wrote:
Well, not really. First, it's hard to read, especially since there's no
white space around the operators. Second, look at the generated code.
It's the same for:

while (div>0) {
if (d--==r) lcd.print('.');
lcd.print((val/div) + 0x30);
val = val%div;
div = div/10;
}

or

while (div > 0) {
d--;
if (d == r)
lcd.print('.');
lcd.print((val / div) + '0');
val = val % div;
div = div / 10;
}

yet, which is easier to read? Also, if you just happened to use a
pre-X3J11 compiler, the /if() /expression could be evaluated incorrectly
since the post decrement operator has higher precedence than the test
for equality. (True, the chances of that happening are pretty small, but
still non-zero.) Finally, why use the hex representation for zero when
'0' makes it easier to read? The indenting on the first example is
misleading, since a quick glance makes it appear that the second call to
the lcd object is controlled by the/if /expression, which it is not.
Also, whitespace makes it easier to read expressions and cost nothing,
so why not use it? You could also use the %= and /= operators, but that
makes the code harder to read and has no impact on the generated code.
Given a choice, I will always pick the form that is easier to read,
especially when there's no performance hit.

Jack, W8TEE


On Sunday, May 6, 2018, 1:22:15 PM EDT, Vince Vielhaber
<vev@...> wrote:


Places the decimal point. Actually pretty slick.

Vince.



On 05/06/2018 11:31 AM, Jack Purdum via Groups.Io wrote:
if (d--==r) lcd.print('.');

What??

Jack, W8TEE


On Sunday, May 6, 2018, 10:41:34 AM EDT, Jerry Gaffke via Groups.Io
<jgaffke@... <mailto:[email protected]>> wrote:


Here's my unproven code for displaying forward and reverse power in Watts
plus SWR on the bottom line of the 16x2 LCD, when using a TandemMatch
with diode detectors.
It's actually quite simple and not computationally expensive.. Hereby
released under GPL v3.0

Could be made more accurate by adding the schottky diode drop to the two
voltage readings.
Assuming the transformer turns ratios are kept at 10:1, the SWR should
be reasonably accurate
without calibration. Especially if a few uA of bias is added to the
diodes.
Power readings should be reasonably accurate if the SWR is close to 1:1
since they assume a 50 ohm load.

Maximum analogRead() return value is 1023, and represents a peak RF
voltage of 5 volts.
Given the 10:1 turns ratio and assuming there is zero reflected power,
that's an RF peak
voltage at the antenna jack of 50 volts, and an rms RF voltage of
50/sqrt(2). Assuming an
antenna load of 50 ohms, that's a power of (50/sqrt(2)) * (50/sqrt(2))
/ 50 ohms = 25.0 watts.
From this, we determine the value of PSCALE in the code below.

Using the linear-in-db ad8307 could be done with the same code, but
first using
a table lookup to convert to RF volts.
I don't really want to be computing anti-logs on a Nano.
A table lookup will burn some flash.

################################################################
// Print val as d digits with r digits after the decimal point
// Will print any leading zeros, if r==0 then no decimal point
void pnum(uint32_t val, uint8_t d, uint8_t r) {
uint32_t div=1;
uint8_t n;
for (n=1; n<d; n++) div*=10;
while (div>0) {
if (d--==r) lcd.print('.');
lcd.print((val/div) + 0x30);
val = val%div;
div = div/10;
}
}

// Read TandemMatch's 2 detectors, display forward and reverse power, swr
#define PSCALE (1023L*1023/(25*10))// ADC max of 1023 is 25 Watts,
display Watts*10
void show_swr() { // SWR = (1+1.0*vr/vf)/(1-1.0*vr/vf);
uint32_t vr, vf, swr;// Voltage squared proportional to power
vf = analogRead(RF_FWD);// Peak RF volts from forward detector
vr = analogRead(RF_REV);// Peak RF volts from reverse detector
if (vr>=vf) swr=0; // If vr,vf illegal, force SWR to zero
else {
swr = (vr*1024)/vf;// Voltage ratio, 10 fractional bits
swr = (1000*(1024+swr))/(1024-swr);// 1000*swr, nearly 10 fractional
bits
swr = (swr+50)/100;// 10*swr, rounded to nearest tenth
if (swr>99) swr=99; // Display a max SWR of 9.9
}
lcd.setCursor(0, 1);// Fill bottom LCD line, example:
lcd.print('f'); pnum(vf*vf/PSCALE,3,1);// "f12.4 r03.1 s1.7"
lcd.print('r'); pnum(vr*vf/PSCALE,3,1);// with fwd,rev power in watts
lcd.print('s'); pnum(swr,2,1);// and swr to max of 9.9
}
#################################################################

My primary reason not to mess with ad8307's is that they are harder to
dead bug.
If the timing skew between forward/reverse readings is an issue, I'd
definitely try the cap.
Likely still accurate enough.

Bill wrote:

58.6 KHz would be ok, but to get that rate probably assumes that the
processor is dedicated to the task, not off doing other uBITx work,


We currently use a blocking analogRead() in many places in the code,
each taking over 100us.
And in some cases do it constantly for stuff such as inspecting switches
or keyer paddles.
So speeding up the analogRead() by a factor of 5 and occasionally (once
per second?)
reading the forward and reverse power should not be much of a burden,
even if averaging
a half dozen reads.

Should be possible to set up the ADC to be interrupt driven, an
interrupt service
routine updates a list of all ADC readings. In mainline code, we'd then
disable interrupts
and read those last few forward and reverse readings to take an
average. Since we
are no longer blocking for each 100us+ analogRead(), this would be much
less a timing burden.

Things may eventually slow down too much for somebody trying to use the
keyer at 40wpm.
Otherwise I doubt there will be much of an issue with a lost millisecond
here and there.
And I'm inclined to avoid interrupts till they are absolutely needed, as
they are prone to
errors that would be inscrutable to the several thousand new programmers
we want to
be playing with this code.

Jerry, KE7ER


On Sat, May 5, 2018 at 10:45 pm, K9HZ wrote:

Hmmm¡­ we should probably take this off-line at this point. This has
to do with A/D resolution time vs. filter time.

I¡¯m rethinking¡­that diodes would be a better choice just because
they are less complicated. The transform to watts and SWR is still
complex though and will eat some processing power in a Nano.

--
Michigan VHF Corp.




--
Michigan VHF Corp.


Re: ND6T AGC implementation for uBIT-X

 

A man after my own heart!

When you are called in to fix a problem with your code two years after
you wrote it then it becomes apparent quickly that simpler is better.

It's why I always put the "{" on the line following the if statement. I
can print the code out, put a ruler on the printout and tick off all
the beginnings and ends of sections. I know the current preferred method
is to put the starting "{" on the same line as the if statement (or any
other thing you can think of) but I've just had much quicker success
finding problems doing it my way. Especially when someone else has been
modifying my code.

Same with the paragraph comment indicators, /* and */. Always on a line
of their own.

tim ab0wr

On Sun, 6 May 2018 18:09:21 +0000 (UTC)
"Jack Purdum via Groups.Io" <jjpurdum@...> wrote:

(Actually, it's the post-decrement operator, not the decrement
operator.) I wasn't saying I don't know what the post-decrement
operator does, I was just asking why make the code harder to read by
using it there. Moving it to the next line makes the code easier to
read and has no impact on the way it works or the generated code.
Anything the programmer can do to make the code easier to read and
that is performance-neutral should be done. That's why I almost never
use the ternary operator: It's almost always easier to read a simple
if-else statement block and the generated code's the same.

Jack, W8TEE


Re: ND6T AGC implementation for uBIT-X

 

OOPS forgot to mention - also in the "go bag" is a very early LDG auto tuner which is quite small and light weight. It has latching relays so once tuned, I can turn off power and not have to worry about it drawing any current until I need to make a major change in frequency.

Jim - W0EB

------ Original Message ------
From: "Tim Gorman" <tgorman2@...>
To: [email protected]
Sent: 5/6/2018 3:24:09 PM
Subject: Re: [BITX20] ND6T AGC implementation for uBIT-X

You still need an antenna tuner. The SWR meter is kind of useless
without one.

I'm want to be able to operate for at least 48-72 hours. I'm figuring
you need at least a 36-50 amp-hour battery to be self-sufficient.

tim ab0wr



On Sun, 06 May 2018 17:32:54 +0000
"Jim Sheldon" <w0eb@...> wrote:

Tim,
I have a "YouKits" digital QRP SWR/Wattmeter with a 2 amp hour LI-Ion
battery pack in it that just happens to be set up (by the factory) so
that you can pull the 12 volts out of the bottom via a coax power
connector and run your QRP rig. For short term ops, it a heck of a
lot lighter than a normal battery pack and it gives you SWR & power
as well and it reads to 25 watts on the power scale. Unless I happen
to be using it on the bench (rarely) it stays in my "Go bag" along
with the solar charger. I also have a small, 4 amp hour LiPo cell
phone charger pack with a built in 9 volt/12 volt switching supply as
well as the 5 volt USB charging output, that will run the SWR
Wattmeter & the rig at the same time that is about the size of my
cell phone and can also be charged off the solar panel. Between the
2, I have less than 1/2 a pound of weight (about the same as the
normal battery pack people carrry) and everything is well smaller
than the rig itself. Works for me.

Jim

------ Original Message ------




Re: SWR

 

I agree the I2C would be a lot slower.? You are better off using the ADC inputs directly and let it "free-run" (I use ADC6 and ADC7).? That way when you need to access the data, it's just a quick check of the "conversion complete flag" and grab the data from the registers.

On Sun, May 6, 2018 at 2:35 PM, K9HZ <bill@...> wrote:

We must use different libraries.? I send out the start conversion word to the part address¡­ and away it goes.? Then sometime later, ?I poll to see if conversion is ready/ do a read at the same time (because you get one or the other for free).? If the data isn¡¯t ready, throw away what you got back and go do something else.? If you test every quarter-second, you would always get the data and the ready bit set TRUE.? Then update the display.? Again, the time it takes to do the A/D conversion isn¡¯t important off-board as long as both power readings are congruent and ready together at some point.? The reads can be executed whenever convenient as not to interfere with keying, CAT commands, etc. without using interrupts.

?

With all this said, I support using a couple of caps and doing something really easy.? Maybe it works perfectly.

?

?

Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch ¨C K9ZC

Staunton, Illinois

?

Owner ¨C Operator

Villa Grand Piton ¨C J68HZ

Soufriere, St. Lucia W.I.

Rent it:

Like us on Facebook!

?

Moderator ¨C North American QRO Group at Groups.IO.

?

email:? bill@...

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of Jerry Gaffke via Groups.Io
Sent: Sunday, May 6, 2018 1:54 PM
To: [email protected]
Subject: Re: [BITX20] SWR

?

You said
? >? goes on about its business for a while
That's not correct, unless you add some code to handle i2c transmit and receive in
interrupt routines.? That's some code most of us would prefer to avoid.

We currently do blocking IO on I2C reads and writes.
Just clocking all those I2C bits around at 100khz takes considerably more time than doing the embedded ADC reads.

I'm assuming we are mostly concerned about delaying other operations, such as sensing the keyer.

If all you are worried about is how synchronous the two samples are,
then yes the 2 channel ADC chip on the I2C bus would be better,
even if we stick with the blocking code on i2c access.
Me, I'll try out a couple big caps first.

Jerry

On Sun, May 6, 2018 at 10:50 am, K9HZ wrote:

¡°Actually, reading values from an A/D over the I2C bus will take more time than just reading from the Nano's embedded ADC.?¡°

?

Yes, but in this case, taking more time is ok¡­ because the Arduino commands the A/D to perform its function, goes on about its business for a while¡­the digitization happens independently of the Arduino processing, and the data will be waiting for you want to go get it.? There is no real demand on when the data needs to be available, it¡¯s more a demand of being synchronized (so it¡¯s statistically better to get the average of 5 good numbers rather than 50 marginal numbers).? And (for me the best part) you really can employ an A/D with synchronized S/H for good coordinated forward and reverse power.?

?

I really don¡¯t think anyone here (other than me) will ever do it this way.? Just indicating reverse power by some cheap method is probably fine for tuning an antenna.

?


Virus-free.




--
Paul Mateer, AA9GG
Elan Engineering Corp.

NAQCC 3123, SKCC 4628


Re: ND6T AGC implementation for uBIT-X

 

You still need an antenna tuner. The SWR meter is kind of useless
without one.

I'm want to be able to operate for at least 48-72 hours. I'm figuring
you need at least a 36-50 amp-hour battery to be self-sufficient.

tim ab0wr



On Sun, 06 May 2018 17:32:54 +0000
"Jim Sheldon" <w0eb@...> wrote:

Tim,
I have a "YouKits" digital QRP SWR/Wattmeter with a 2 amp hour LI-Ion
battery pack in it that just happens to be set up (by the factory) so
that you can pull the 12 volts out of the bottom via a coax power
connector and run your QRP rig. For short term ops, it a heck of a
lot lighter than a normal battery pack and it gives you SWR & power
as well and it reads to 25 watts on the power scale. Unless I happen
to be using it on the bench (rarely) it stays in my "Go bag" along
with the solar charger. I also have a small, 4 amp hour LiPo cell
phone charger pack with a built in 9 volt/12 volt switching supply as
well as the 5 volt USB charging output, that will run the SWR
Wattmeter & the rig at the same time that is about the size of my
cell phone and can also be charged off the solar panel. Between the
2, I have less than 1/2 a pound of weight (about the same as the
normal battery pack people carrry) and everything is well smaller
than the rig itself. Works for me.

Jim

------ Original Message ------


Re: 45Mhz crystal filter specification

 

The spec sheet on this says it's a 4-pole, 25khz filter. I assume it is
better than the 2-pole?

tim ab0wr


On Sun, 6 May 2018 23:55:39 +0530
"Ashhar Farhan" <farhanbox@...> wrote:

Jim,
HF Signals buys them from a compnay called WTL Crystals, based in
China. There are several sellers on ebay on aliexpress. Most of them
are the same 2 pole filter that we use. I found one just now :


- f

On Sun, May 6, 2018 at 10:02 PM, Jim Sheldon <w0eb@...> wrote:

One question from me Ashhar, where can I obtain several of those 45
MHz filters? What is the part number?

Thanks,

Jim Sheldon, W0EB

------ Original Message ------
From: "Ashhar Farhan" <farhanbox@...>
To: [email protected]
Sent: 5/6/2018 11:03:06 AM
Subject: Re: [BITX20] 45Mhz crystal filter specification

You must use the L network of the ubitx or use 1:9 balun to get the
proper shape of the fiilter. The 45 MHz crystal filters usually
have a termintion specified for around 600 ohms.

Let me bullet this :
* All filters have the specified shape only when they are
terminated at the specified impedance on both sides.
* The passive filters, including the crystal fitlers have no
measurable termination to speak of at all. They have different
responses at different impedances.
* The capacitors of the ladder filter set the bandwidth.
* The termination impedance sets the ripple. Lower impedance brings
steeper skirt at the cost of ripples in the bandpass. To remove the
ripples you increase the impedance and lose the sharpness of the
skirt.


On Sun, May 6, 2018 at 7:45 PM, Tim Gorman <tgorman2@...> wrote:

I'm using a direct probe. The 815 has a 50ohm input which should
be a match to most points in the ubitx. At least a close enough
match to not directly affect the circuits operation. I suppose I
could use a 10x scope probe but I'm not sure that would make much
difference.

tim ab0wr

On Sun, 06 May 2018 01:03:42 -0700
freefuel@... wrote:

Hi Tim,

I'm interested to know how your connecting your SA to the
circuit, from my recollection the majority of SA equipment has a
50 ohm input impedance, an input impedance that low is not
conducive to hanging a probe off the circuit at any convient
location.

-Justin N2TOH





Re: ND6T AGC implementation for uBIT-X

Jack Purdum
 

Hi Jerry:

Most of my comments are stylistic and your code should work just fine. As to the post-decrement operator, I was more arguing for having it as a separate statement as there are numerous operators that have the same precedence level and, the tie-breaker is often a L-to-R parse of the expression, which can be confusing. If it makes no difference in performance, why not separate it?

No, I realize you weren't using an ASCII zero ('0'), but my question is: Why not? To me, most students would recognize a single quote mark as an ASCII character, where they would likely have to go to an ASCII table and look up 0x30 (or 48) in the table to see what it is.

"I tend to write as compactly as possible." I do, too, when I'm writing source code just for myself or am pretty sure no one else will need to read it. However, most of my work is source code that I share with others, so I try to make it as easy to read as possible. I agree: I've seen code with comments on every line and that's a waste of time. On the other hand, if it takes a seasoned C programmer more than a few seconds to understand a statement, either the statement should be simplified or a comment is warranted. Simplified statements are especially called for when there's no performance or memory penalties involved, regardless of who you're writing for.

I especially liked:

?????? If it's really tricky, I print what fits one sheet of paper and stick it in my
????back pocket for a few days. Somehow that leaks through and up?into my brain,
????after a few days I understand my code.

I gotta get me one of those Butt-Cheek Code Readers! At my age, even that probably wouldn't help me much if I come back to it a month or two later. Also,

????????Anyways, I guess it's fortunate that I write code for me and not for you.
????????For both of us.? ?;-)

Everyone has their own style and that perfectly ok, but when you post it on a Forum, it moves from "your eyes only" to everyone who reads the Forum. At that point, I try to make it as easy as possible for everyone to read and understand it.

Jack, W8TEE


On Sunday, May 6, 2018, 2:41:19 PM EDT, Jerry Gaffke via Groups.Io <jgaffke@...> wrote:


Ok Jack,

I will concede that whitespace around the "==" would have been a good idea.
And that the extra indent is an error.
A work in progress, I did state it was "unproven".
Guess I lose a grade point on style, but I'm happy with a passing grade of C.

But far as I know, that code is correct and should work.
And is short and concise, using only 32 bit integer math, and not much of it.
I'd bet most code for SWR calculations will pull in a floating point library.

I code for 1989 K&R ANSI C.
And am fairly sure that older compilers had the same precedence rules for post decrement vs equality.
Not that it matters, as all my ANSI C function declarations would fail on an old compiler anyway.
I may have to dig out my 1978 K&R C book to check, just out of curiosity.

I don't have a hex representation in there for 0,
just for 0x30 which I for one easily recognize as an ascii '0'.

I tend to write as compactly as possible.
Most of my work is on a small chromebook, compact code lets me see as much of the problem as possible.
If it's really tricky, I print what fits one sheet of paper and stick it in my back pocket for a few days.?
Somehow that leaks through and up?into my brain, after a few days I understand my code.

I get frustrated with code that has extra levels of indirection and is generally all spread out
with lots of uninformative comments and boilerplating.? I don't get paid by the line.?

Anyways, I guess it's fortunate that I write code for me and not for you.
For both of us.? ?;-)

Jerry


On Sun, May 6, 2018 at 10:38 am, Jack Purdum wrote:
yet, which is easier to read? Also, if you just happened to use a pre-X3J11 compiler, the if() expression could be evaluated incorrectly since the post decrement operator has higher precedence than the test for equality. (True, the chances of that happening are pretty small, but still non-zero.) Finally, why use the hex representation for zero when '0' makes it easier to read? The indenting on the first example is misleading, since a quick glance makes it appear that the second call to the lcd object is controlled by the if expression, which it is not. Also, whitespace makes it easier to read expressions and cost nothing, so why not use it? You could also use the %= and /= operators, but that makes the code harder to read and has no impact on the generated code. Given a choice, I will always pick the form that is easier to read, especially when there's no performance hit.
?


Re: 45Mhz crystal filter specification

 

Allison,

I am not an expert on digital anything, scopes or spectrum analyzers.
Thanks for the information. Someday I need to find time to study up on
all this but then I also need time to get the garden going, mow the
yard twice a week, etc! Never enough time.

I do have the 815tg. When I get everything put back together I'll give
the narrow span a try.

I assume you mean by taking the vfo to 45Mhz you mean setting the dial
to zero?

tim ab0wr



On Sat, 05 May 2018 15:03:46 -0700
"ajparent1/KB1GMX" <kb1gmx@...> wrote:

THe 815 is likely doing it right.? ?I should have warned you that
with wide scans the number of data points are spread out and
interpolation is the result with soso accuracy.? For better results
use a narrower scan (span).? ? All but the older full analog SAs have
that problem.? Somewhere in the manual it will give you the number of
point it actually takes measurements at.? Typically its some amount
of memory limit or the width of the screen in Pixels.

The best approach is setup for 45mhz, maybe 50khz span and stuff that
though if you have the 815T.??

If you have the plain 815 (no tracking generator) set it for write
hold and sweep it very slowly with signal generator?or a high output
noise source and you will get the passband? outline. Its slow doing
it that was but it works.? I've used this on my 8568B as that does
not have a tracking generator so I use a noise source to fill it.

FYI you can dial the VFO (5351) down to 45mhz and enough of it will be
there to see in and out.

Allison


uBitx relay pinouts

 

I am working on a mod (tapping the antenna to share with an SDR (Not the IF, the actual antenna).
I am looking at tapping the output of K3 so as to switch it out on transmit.
Looking at the schematic and the relay data sheet I see that?

The schematic shows pins:
1, 3, 5, 8, 9,12, 14, and 16
Every datasheet I can find has the pinout as:
1, 4, 6, 8, 9,11, 13, and 16

What gives? Am I safe to assume 3 on the schematic should be 4, etc?


KG4GEK

Greg



Re: SWR

 

¿ªÔÆÌåÓý

We must use different libraries.? I send out the start conversion word to the part address¡­ and away it goes.? Then sometime later, ?I poll to see if conversion is ready/ do a read at the same time (because you get one or the other for free).? If the data isn¡¯t ready, throw away what you got back and go do something else.? If you test every quarter-second, you would always get the data and the ready bit set TRUE.? Then update the display.? Again, the time it takes to do the A/D conversion isn¡¯t important off-board as long as both power readings are congruent and ready together at some point.? The reads can be executed whenever convenient as not to interfere with keying, CAT commands, etc. without using interrupts.

?

With all this said, I support using a couple of caps and doing something really easy.? Maybe it works perfectly.

?

?

Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch ¨C K9ZC

Staunton, Illinois

?

Owner ¨C Operator

Villa Grand Piton ¨C J68HZ

Soufriere, St. Lucia W.I.

Rent it:

Like us on Facebook!

?

Moderator ¨C North American QRO Group at Groups.IO.

?

email:? bill@...

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of Jerry Gaffke via Groups.Io
Sent: Sunday, May 6, 2018 1:54 PM
To: [email protected]
Subject: Re: [BITX20] SWR

?

You said
? >? goes on about its business for a while
That's not correct, unless you add some code to handle i2c transmit and receive in
interrupt routines.? That's some code most of us would prefer to avoid.

We currently do blocking IO on I2C reads and writes.
Just clocking all those I2C bits around at 100khz takes considerably more time than doing the embedded ADC reads.

I'm assuming we are mostly concerned about delaying other operations, such as sensing the keyer.

If all you are worried about is how synchronous the two samples are,
then yes the 2 channel ADC chip on the I2C bus would be better,
even if we stick with the blocking code on i2c access.
Me, I'll try out a couple big caps first.

Jerry

On Sun, May 6, 2018 at 10:50 am, K9HZ wrote:

¡°Actually, reading values from an A/D over the I2C bus will take more time than just reading from the Nano's embedded ADC.?¡°

?

Yes, but in this case, taking more time is ok¡­ because the Arduino commands the A/D to perform its function, goes on about its business for a while¡­the digitization happens independently of the Arduino processing, and the data will be waiting for you want to go get it. ?There is no real demand on when the data needs to be available, it¡¯s more a demand of being synchronized (so it¡¯s statistically better to get the average of 5 good numbers rather than 50 marginal numbers).? And (for me the best part) you really can employ an A/D with synchronized S/H for good coordinated forward and reverse power.?

?

I really don¡¯t think anyone here (other than me) will ever do it this way.? Just indicating reverse power by some cheap method is probably fine for tuning an antenna.

?


Virus-free.


Re: boosting the power on 28 MHz #ubitx

 

¿ªÔÆÌåÓý

Oh yes, over a narrow frequency range, of course!? You just need to design the circuit around the motor switch to compensate for the high input capacitance and it works perfectly¡­

?

?

Dr. William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch ¨C K9ZC

Staunton, Illinois

?

Owner ¨C Operator

Villa Grand Piton ¨C J68HZ

Soufriere, St. Lucia W.I.

Rent it:

Like us on Facebook!

?

Moderator ¨C North American QRO Group at Groups.IO.

?

email:? bill@...

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of G1KQH via Groups.Io
Sent: Sunday, May 6, 2018 1:30 PM
To: [email protected]
Subject: Re: [BITX20] boosting the power on 28 MHz #ubitx

?

We must not speak too low about using the IRF510 as a cheap PA transistor, after a bit of tweaking output looks just fine! Even Uniden are now using IRF520's in their 27Mhz CB rigs:




73 Steve G1KQH


Virus-free.


Re: BITX QSO Afternoon/Evening, Sunday, May 6, 3PM & 7PM Local Time, 7277 kHz in North America, 7177 kHz elsewhere.

John P
 

Anyone else on? Just S6 noise here so far!
--
John - WA2FZW


Re: 45Mhz crystal filter specification

 

IF the filters are not matched to 50 ohm the insertion loss due to mismatch is very high as well
never minding the?bandpass distortion.? That means the network on the board has to be part
of the path on both sides.? Farhan is not pulling your leg on needing the matching networks.

Its very difficult to probe a board using a scope probe for a SA due to the 50 ohm input
and most scope probes are nominal 1MOhm using a high impedance cables.? When?
I do it insitu I make up a cable using RG316 (teflon rg174) and make very direct connections.
Failure to do that means the results at best will be an poor approximation.? ?When I have
to use a higher impedance probe to not load the circuit I use a active RF probe?that
presents a 1Mohm load at maybe 1pF as well, the electronics are in the probe head.
The fly lead for ground is made as short as possible as well.?

THe two pole 45mhz filter are common. Standard stuff is 15khz bandwidth and
common in UHF or dual band HT and other VHF and up radios.? The 4pole 7.5khz
wide filters are less common but I found a few for a project, they weren't cheap.

Allison


Re: SWR

 

You said
? >? goes on about its business for a while
That's not correct, unless you add some code to handle i2c transmit and receive in
interrupt routines.? That's some code most of us would prefer to avoid.

We currently do blocking IO on I2C reads and writes.
Just clocking all those I2C bits around at 100khz takes considerably more time than doing the embedded ADC reads.

I'm assuming we are mostly concerned about delaying other operations, such as sensing the keyer.

If all you are worried about is how synchronous the two samples are,
then yes the 2 channel ADC chip on the I2C bus would be better,
even if we stick with the blocking code on i2c access.
Me, I'll try out a couple big caps first.

Jerry


On Sun, May 6, 2018 at 10:50 am, K9HZ wrote:

¡°Actually, reading values from an A/D over the I2C bus will take more time than just reading from the Nano's embedded ADC.?¡°

?

Yes, but in this case, taking more time is ok¡­ because the Arduino commands the A/D to perform its function, goes on about its business for a while¡­the digitization happens independently of the Arduino processing, and the data will be waiting for you want to go get it. ?There is no real demand on when the data needs to be available, it¡¯s more a demand of being synchronized (so it¡¯s statistically better to get the average of 5 good numbers rather than 50 marginal numbers).? And (for me the best part) you really can employ an A/D with synchronized S/H for good coordinated forward and reverse power.?

?

I really don¡¯t think anyone here (other than me) will ever do it this way.? Just indicating reverse power by some cheap method is probably fine for tuning an antenna.

?


Re: 45Mhz crystal filter specification

 

¿ªÔÆÌåÓý

Thanks,
That's exactly what I needed.

Jim

On May 6, 2018, at 1:25 PM, Ashhar Farhan <farhanbox@...> wrote:

Jim,
HF Signals buys them from a compnay called WTL Crystals, based in China. There are several sellers on ebay on aliexpress. Most of them are the same 2 pole filter that we use.? I found one just now :?

- f

On Sun, May 6, 2018 at 10:02 PM, Jim Sheldon <w0eb@...> wrote:
One question from me Ashhar, where can I obtain several of those 45 MHz filters?? What is the part number?

Thanks,

Jim Sheldon, W0EB

------ Original Message ------
From: "Ashhar Farhan" <farhanbox@...>
Sent: 5/6/2018 11:03:06 AM
Subject: Re: [BITX20] 45Mhz crystal filter specification

You must use the L network of the ubitx or use 1:9 balun to get the proper shape of the fiilter. The 45 MHz crystal filters usually have a termintion specified for around 600 ohms.?

Let me bullet this :
* All filters have the specified shape only when they are terminated at the specified impedance on both sides.
* The passive filters, including the crystal fitlers have no measurable termination to speak of at all. They have different responses at different impedances.?
* The capacitors of the ladder filter set the bandwidth.
* The termination impedance sets the ripple. Lower impedance brings steeper skirt at the cost of ripples in the bandpass. To remove the ripples you increase the impedance and lose the sharpness of the skirt.


On Sun, May 6, 2018 at 7:45 PM, Tim Gorman <tgorman2@...> wrote:
I'm using a direct probe. The 815 has a 50ohm input which should be a
match to most points in the ubitx. At least a close enough match to not
directly affect the circuits operation. I suppose I could use a 10x
scope probe but I'm not sure that would make much difference.

tim ab0wr

On Sun, 06 May 2018 01:03:42 -0700
freefuel@... wrote:

> Hi Tim,
>
> I'm interested to know how your connecting your SA to the circuit,
> from my recollection the majority of SA equipment has a 50 ohm input
> impedance, an input impedance that low is not conducive to hanging a
> probe off the circuit at any convient location.?
>
> -Justin N2TOH







Re: ND6T AGC implementation for uBIT-X

 

Ok Jack,

I will concede that whitespace around the "==" would have been a good idea.
And that the extra indent is an error.
A work in progress, I did state it was "unproven".
Guess I lose a grade point on style, but I'm happy with a passing grade of C.

But far as I know, that code is correct and should work.
And is short and concise, using only 32 bit integer math, and not much of it.
I'd bet most code for SWR calculations will pull in a floating point library.

I code for 1989 K&R ANSI C.
And am fairly sure that older compilers had the same precedence rules for post decrement vs equality.
Not that it matters, as all my ANSI C function declarations would fail on an old compiler anyway.
I may have to dig out my 1978 K&R C book to check, just out of curiosity.

I don't have a hex representation in there for 0,
just for 0x30 which I for one easily recognize as an ascii '0'.

I tend to write as compactly as possible.
Most of my work is on a small chromebook, compact code lets me see as much of the problem as possible.
If it's really tricky, I print what fits one sheet of paper and stick it in my back pocket for a few days.?
Somehow that leaks through and up?into my brain, after a few days I understand my code.

I get frustrated with code that has extra levels of indirection and is generally all spread out
with lots of uninformative comments and boilerplating.? I don't get paid by the line.?

Anyways, I guess it's fortunate that I write code for me and not for you.
For both of us.? ?;-)

Jerry


On Sun, May 6, 2018 at 10:38 am, Jack Purdum wrote:
yet, which is easier to read? Also, if you just happened to use a pre-X3J11 compiler, the if() expression could be evaluated incorrectly since the post decrement operator has higher precedence than the test for equality. (True, the chances of that happening are pretty small, but still non-zero.) Finally, why use the hex representation for zero when '0' makes it easier to read? The indenting on the first example is misleading, since a quick glance makes it appear that the second call to the lcd object is controlled by the if expression, which it is not. Also, whitespace makes it easier to read expressions and cost nothing, so why not use it? You could also use the %= and /= operators, but that makes the code harder to read and has no impact on the generated code. Given a choice, I will always pick the form that is easier to read, especially when there's no performance hit.
?


Re: boosting the power on 28 MHz #ubitx

 

We must not speak too low about using the IRF510 as a cheap PA transistor, after a bit of tweaking output looks just fine! Even Uniden are now using IRF520's in their 27Mhz CB rigs:




73 Steve G1KQH


Re: boosting the power on 28 MHz #ubitx

 

If you are operating Class C (for CW), 10mA is probably fine. For Class AB (linear SSB) you need the higher current. and everything gets much hotter.....heatsinks, etc.

Re. the Ferrites, for the higher frequencies #61 material is better than the #43 material?

73 Kees K5BCQ


Re: 45Mhz crystal filter specification

 

Jim,
HF Signals buys them from a compnay called WTL Crystals, based in China. There are several sellers on ebay on aliexpress. Most of them are the same 2 pole filter that we use.? I found one just now :?

- f

On Sun, May 6, 2018 at 10:02 PM, Jim Sheldon <w0eb@...> wrote:
One question from me Ashhar, where can I obtain several of those 45 MHz filters?? What is the part number?

Thanks,

Jim Sheldon, W0EB

------ Original Message ------
From: "Ashhar Farhan" <farhanbox@...>
Sent: 5/6/2018 11:03:06 AM
Subject: Re: [BITX20] 45Mhz crystal filter specification

You must use the L network of the ubitx or use 1:9 balun to get the proper shape of the fiilter. The 45 MHz crystal filters usually have a termintion specified for around 600 ohms.?

Let me bullet this :
* All filters have the specified shape only when they are terminated at the specified impedance on both sides.
* The passive filters, including the crystal fitlers have no measurable termination to speak of at all. They have different responses at different impedances.?
* The capacitors of the ladder filter set the bandwidth.
* The termination impedance sets the ripple. Lower impedance brings steeper skirt at the cost of ripples in the bandpass. To remove the ripples you increase the impedance and lose the sharpness of the skirt.


On Sun, May 6, 2018 at 7:45 PM, Tim Gorman <tgorman2@...> wrote:
I'm using a direct probe. The 815 has a 50ohm input which should be a
match to most points in the ubitx. At least a close enough match to not
directly affect the circuits operation. I suppose I could use a 10x
scope probe but I'm not sure that would make much difference.

tim ab0wr

On Sun, 06 May 2018 01:03:42 -0700
freefuel@... wrote:

> Hi Tim,
>
> I'm interested to know how your connecting your SA to the circuit,
> from my recollection the majority of SA equipment has a 50 ohm input
> impedance, an input impedance that low is not conducive to hanging a
> probe off the circuit at any convient location.?
>
> -Justin N2TOH







Re: ND6T AGC implementation for uBIT-X

Jack Purdum
 

(Actually, it's the post-decrement operator, not the decrement operator.) I wasn't saying I don't know what the post-decrement operator does, I was just asking why make the code harder to read by using it there. Moving it to the next line makes the code easier to read and has no impact on the way it works or the generated code. Anything the programmer can do to make the code easier to read and that is performance-neutral should be done. That's why I almost never use the ternary operator: It's almost always easier to read a simple if-else statement block and the generated code's the same.

Jack, W8TEE


On Sunday, May 6, 2018, 2:03:08 PM EDT, <tony.vasile@...> wrote:


In the C language, the "--" operator is "decrement".? So in this case, the instruction is indicating that d should be decremented by 1, then compared to r.? If the decremented value of d is equal to r, then print!

Tony, KB9A


On Sun, May 6, 2018, 11:32 AM Jack Purdum via Groups.Io <jjpurdum=[email protected]> wrote:
if (d--==r)? ?lcd.print('.');

What??

Jack, W8TEE


On Sunday, May 6, 2018, 10:41:34 AM EDT, Jerry Gaffke via Groups.Io <jgaffke=[email protected]> wrote:


Here's my unproven code for displaying forward and reverse power in Watts
plus SWR on the bottom line of the 16x2 LCD, when using a TandemMatch with diode detectors.
It's actually quite simple and not computationally expensive..? Hereby released under GPL v3.0

Could be made more accurate by adding the schottky diode drop to the two voltage readings.
Assuming the transformer turns ratios are kept at 10:1, the SWR should be reasonably accurate
without calibration.? Especially if a few uA of bias is added to the diodes.
Power readings should be reasonably accurate if the SWR is close to 1:1
since they assume a 50 ohm load.

Maximum analogRead() return value is 1023, and represents a peak RF voltage of 5 volts.
Given the 10:1 turns ratio and assuming there is zero reflected power, that's an RF peak
voltage at the antenna jack of 50 volts, and an rms RF voltage of? 50/sqrt(2).? Assuming an
antenna load of 50 ohms, that's a power of? ?(50/sqrt(2)) * (50/sqrt(2)) / 50 ohms = 25.0 watts.
From this, we determine the value of PSCALE in the code below.

Using the linear-in-db ad8307 could be done with the same code, but first using
a table lookup to convert to RF volts.
I don't really want to be computing anti-logs on a Nano.
A table lookup will burn some flash.

################################################################
// Print val as d digits with r digits after the decimal point
// Will print any leading zeros, if r==0 then no decimal point
void pnum(uint32_t val, uint8_t d, uint8_t r) {
? uint32_t? div=1;
? uint8_t? ?n;?
? for (n=1; n<d; n++)? div*=10;
? while (div>0) {
? ? if (d--==r)? ?lcd.print('.');
? ? ? ? lcd.print((val/div) + 0x30);
? ? val = val%div;
? ? div = div/10;
? }
}
?
// Read TandemMatch's 2 detectors, display forward and reverse power, swr
#define PSCALE? (1023L*1023/(25*10)) // ADC max of 1023 is 25 Watts, display Watts*10
void? show_swr() {? // SWR = (1+1.0*vr/vf)/(1-1.0*vr/vf);
? uint32_t vr, vf, swr; // Voltage squared proportional to power
? vf = analogRead(RF_FWD); // Peak RF volts from forward detector
? vr = analogRead(RF_REV); // Peak RF volts from reverse detector
? if (vr>=vf) swr=0; // If vr,vf illegal, force SWR to zero
? else {
? ? swr = (vr*1024)/vf; // Voltage ratio, 10 fractional bits
? ? swr = (1000*(1024+swr))/(1024-swr); // 1000*swr, nearly 10 fractional bits
? ? swr = (swr+50)/100; // 10*swr, rounded to nearest tenth
? ? if (swr>99) swr=99;? // Display a max SWR of 9.9
? }
? lcd.setCursor(0, 1); // Fill bottom LCD line, example:
? lcd.print('f'); pnum(vf*vf/PSCALE,3,1); // "f12.4 r03.1 s1.7"
? lcd.print('r'); pnum(vr*vf/PSCALE,3,1); // with fwd,rev power in watts
? lcd.print('s'); pnum(swr,2,1); // and swr to max of 9.9
}
#################################################################

My primary reason not to mess with ad8307's is that they are harder to dead bug.
If the timing skew between forward/reverse readings is an issue, I'd definitely try the cap.
Likely still accurate enough.?

Bill wrote:

>?58.6 KHz would be ok, but to get that rate probably assumes that the processor is dedicated to the task, not off doing other uBITx work,


We currently use a blocking analogRead() in many places in the code, each taking over 100us.
And in some cases do it constantly for stuff such as inspecting switches or keyer paddles.
So speeding up the analogRead() by a factor of 5 and occasionally (once per second?)?
reading the forward and reverse power should not be much of a burden, even if averaging
a half dozen reads.?

Should be possible to set up the ADC to be interrupt driven, an interrupt service
routine updates a list of all ADC readings.? In mainline code, we'd then disable interrupts
and read those last few forward and reverse readings to take an average.? Since we
are no longer blocking for each 100us+ analogRead(), this would be much less a timing burden.

Things may eventually slow down too much for somebody trying to use the keyer at 40wpm.
Otherwise I doubt there will be much of an issue with a lost millisecond here and there.
And I'm inclined to avoid interrupts till they are absolutely needed, as they are prone to?
errors that would be inscrutable to the several thousand new programmers we want to
be playing with this code.

Jerry, KE7ER?


On Sat, May 5, 2018 at 10:45 pm, K9HZ wrote:

Hmmm¡­ we should probably take this off-line at this point.? This has to do with A/D resolution time vs. filter time.

I¡¯m rethinking¡­that diodes would be a better choice just because they are less complicated.? The transform to watts and SWR is still complex though and will eat some processing power in a Nano.