Topics

Attenuator function in CEC firmware #ubitx #firmware #nextion

Jack Brabham - KZ5A
 

I looked around but haven't found just how the "attenuator" function in the CEC firmware actually works.

I'm curious because I'm interested in the mod that puts a digital attenuator between the pre-drivers and the filters, using it as a varible attenuator on RX and using it to normaiize the output levels between bands on TX.

More to the point, I'm wondering if the Attn function can be utilized to control the digital attenuator on RX instead of whatever it does normally?

73 Jack KZ5A

Tom, wb6b
 

Some time ago, a clever person on this list developed a method of adjusting the mixer frequencies to place the desired signal on the edge of the 45Mhz filter. That filter being much wider than the signal and having a more gradual drop-off (Than the 12Mhz filter for example) on the edges of the bandpass, could function as a variable gain stage by moving the desired signal progressively into the edge of the bandpass.

The CEC firmware incorporated this gain control method. This might be the attenuator function you are looking for.  It has been a while since I looked at this so I believe it was used to adjust output power, but I may be wrong. Might be a clever idea to try to measure the received signal and have the firmware adjust the mixer frequencies to act as an AGC. Maybe that is already being done.

Tom, wb6b

Jerry Gaffke
 

The clever person is John, VK2ETA.
Here's where it started:
    https://groups.io/g/BITX20/topic/16737180
    https://groups.io/g/BITX20/topic/17009424

And we have an active thread right now about doing this with CW:
    https://groups.io/g/BITX20/topic/30997272

And a mention of it yesterday here:
    https://groups.io/g/BITX20/message/67982

It works by adjusting the si5351 to move the frequency at which the desired signal
hits the 45mhz crystal filter.  The filter has shoulders gradual enough that this serves
as an effective attenuator.  Works great for transmitting, where you set it once based
on the operating frequency and desired output power.  Using this method to dynamically
shape the receive attenuation would be sort of possible but not very satisifying
since there would be a pop heard every time the si5351 is updated.

There have been a half dozen different schemes for implementing simple AGC schemes
on the uBitx (and Bitx40).  I'd recommend Don's (ND6T) scheme as was kitted up
by Kees (K5BCQ).    http://www.nd6t.com/uBITX/AGC.htm
The kits are no longer available, but would be simple enough to dead bug it.
Others here will have their own favorites.
They pretty much all rectify the recovered audio to determine the amount of attenuation,
applying a DC voltage to some attenuation device.
You could easily control that attenuation from a processor, perhaps using pulse-width-modulation
to determine the amount of attenuation, though better would be an small ADC hanging off the I2C lines.

Jerry, KE7ER

KE2GKB
 

Just to comment here and pass some info on, Don's (ND6T's) AGC is available as a kit from N8DAH and my Self over at https://shop.kit-projects.com We are still working on talking to Don to get him to update his web page. We have his blessing but nothing has been updated yet on his end.

-- Tim Keller - KE2GKB https://shop.kit-projects.com

John (vk2eta)
 

Thanks guys for the qualification, but luck had its place in that exercise.

Jack,

Here is the correct graph and if you follow the thread it shows the logic (the first graph is wrong by a factor of 10 on the horizontal axis): https://groups.io/g/BITX20/message/45700

If you follow the usage of the firstIFShift variable in the implementation below you will see the code that implements a stepped power setting per band so that I have three levels (low=5W, medium=10W and max=open). I simply use a set of 4 values for each levels which represent the shift in KHz at 4 frequencies, then I interpolate for frequencies in-between. Moves up and down a little due to the interpolation but it does the job. You could have one set of value per band if you wanted to be more precise.

There is even some dead code (commented out) in there for an automatic ALC as you find in commercial rigs. But it didn't play well with my ATU so I used a fixed ALC instead.

In the file section: https://groups.io/g/BITX20/files/Variations%20on%20KD8CEC%20Software%20%28by%20VK2ETA%29%20+%20ATU%20sketch

I also use the IF shift in reception to augment the range of my AGC and it does the job. But as Jerry mentioned it makes a small pop when adjusting the shift. Not annoying in my case as I only adjust when the ALC hits the top of its range and step back only when it reaches the bottom of its range. So it normally happens on very strong stations and once at the start and end of an over. Not a major at all, but you will notice it. That code in in there too.

If you have questions on the code please ask.

All the best,

73, John

Jerry Gaffke
 

Good, thanks for the correction.
And good to know the ND6T scheme is still available as a kit.

I think I probably knew that once, but I'm not sure I can remember even that!

Jerry


On Thu, Apr 18, 2019 at 05:10 PM, KE2GKB wrote:

Just to comment here and pass some info on, Don's (ND6T's) AGC is available as a kit from N8DAH and my Self over at https://shop.kit-projects.com We are still working on talking to Don to get him to update his web page. We have his blessing but nothing has been updated yet on his end.

-- Tim Keller - KE2GKB https://shop.kit-projects.com

Jack Brabham - KZ5A
 

Funny you should mention the ND6T AGC, I just got one in the mail today from kit-projects.com.

My uBITX V.5 will be here tomorrow (love the DHL tracking).  Nextion 3.5 has been here for a few days.

The nice Cheval SA case from Bangkok probably won't be here for a month.  Hopefully by then I will have figured out how many and what sized holes it needs where.

I intend to go thru stock operation for a while (probably a short while) before loading the CEC firmware, just so I can better appreciate the differences.

As far as the ATTN goes, I try to follow the wisdom of "If it ain't broke, don't fix it".  I may or may not decide it needs fixin',  as the approach obviously works but seems a little "non-optimal".  I'm not one to fret over increasing the parts count and the digital attn idea is very compelling.  We'll see, I've got a lot of learning curve to wade thru first.

73 Jack KZ5A











On 4/18/2019 5:26 PM, Jerry Gaffke via Groups.Io wrote:
The clever person is John, VK2ETA.
Here's where it started:
    https://groups.io/g/BITX20/topic/16737180
    https://groups.io/g/BITX20/topic/17009424

And we have an active thread right now about doing this with CW:
    https://groups.io/g/BITX20/topic/30997272

And a mention of it yesterday here:
    https://groups.io/g/BITX20/message/67982

It works by adjusting the si5351 to move the frequency at which the desired signal
hits the 45mhz crystal filter.  The filter has shoulders gradual enough that this serves
as an effective attenuator.  Works great for transmitting, where you set it once based
on the operating frequency and desired output power.  Using this method to dynamically
shape the receive attenuation would be sort of possible but not very satisifying
since there would be a pop heard every time the si5351 is updated.

There have been a half dozen different schemes for implementing simple AGC schemes
on the uBitx (and Bitx40).  I'd recommend Don's (ND6T) scheme as was kitted up
by Kees (K5BCQ).    http://www.nd6t.com/uBITX/AGC.htm
The kits are no longer available, but would be simple enough to dead bug it.
Others here will have their own favorites.
They pretty much all rectify the recovered audio to determine the amount of attenuation,
applying a DC voltage to some attenuation device.
You could easily control that attenuation from a processor, perhaps using pulse-width-modulation
to determine the amount of attenuation, though better would be an small ADC hanging off the I2C lines.

Jerry, KE7ER


Tom, wb6b
 

On Thu, Apr 18, 2019 at 04:26 PM, Jerry Gaffke wrote:
You could easily control that attenuation from a processor, perhaps
These may be a little overboard for the purpose but I have one of each of these digitally controlled attenuators that I bought to build up my tool set for making RF measurements. 

This one had the part number of the attenuator chip ground off. Depending on the manufacture of the part, the specified low frequency cutoff could be 9Khz, 1Mhz or 10Mhz. For HF measurements a possible 10Mhz cutoff is an issue.
https://www.ebay.com/itm/New-OLED-6G-Digital-Programmable-Attenuator-30DB-step-0-25-RF-Module-Micro-USB-/263584061842
However, the construction with the machined aluminum body is impressive.

This one specifies the part number in the description and the number on the attenuator chip matches. It is a 9Khz to 4Ghz attenuator. It doesn't have a display, so would be a better choice for installing into the uBitx. 
https://www.ebay.com/itm/PE4302-Digital-RF-Step-Attenuator-Module-High-Linearity-0-5dB-50-ohm-RF-DSA/121830578745

You can also buy the current version of the Peregrine attenuator chip from Digikey, mount it on a SMD adaptor board and add it to your uBitx IF chain. But, the modules are easier to work with.

These parts have an actual 50 ohm impedance (when the other end is 50 ohm terminated). It might be that the 50 ohms is a bit more load that the IF chain was designed for. 

Tom, wb6b


 

Jack Brabham - KZ5A
 

Tom,

The 4302 or the newer 4312 (which seems hard to find) are the modules I'm thinking of.    I think the 4302 was mentioned in ZL1AXG's article.

The placement between the LPF and the pre-driver puts the ATTN in the antenna path on RX which is presumably 50 ohm and I assume is also 50 ohm on TX considering the by-directional LPF.

This placement, to non-engineer me, looks like the ideal "effector" location for an RX AGC scheme, ahead of any active devices.    Or it could just be setup as a manual RF gain control on RX.   It is also looks like a very straight forward way to control drive levels per band on TX, either via pre-sets or an ALC setup.

I'm also thinking that this approach should be largely free of "unintended consequences".

In any case it looks like an enjoyable experiment.

73 Jack KZ5A




On 4/19/2019 5:10 AM, Tom, wb6b wrote:
On Thu, Apr 18, 2019 at 04:26 PM, Jerry Gaffke wrote:
You could easily control that attenuation from a processor, perhaps
These may be a little overboard for the purpose but I have one of each of these digitally controlled attenuators that I bought to build up my tool set for making RF measurements. 

This one had the part number of the attenuator chip ground off. Depending on the manufacture of the part, the specified low frequency cutoff could be 9Khz, 1Mhz or 10Mhz. For HF measurements a possible 10Mhz cutoff is an issue.
https://www.ebay.com/itm/New-OLED-6G-Digital-Programmable-Attenuator-30DB-step-0-25-RF-Module-Micro-USB-/263584061842
However, the construction with the machined aluminum body is impressive.

This one specifies the part number in the description and the number on the attenuator chip matches. It is a 9Khz to 4Ghz attenuator. It doesn't have a display, so would be a better choice for installing into the uBitx. 
https://www.ebay.com/itm/PE4302-Digital-RF-Step-Attenuator-Module-High-Linearity-0-5dB-50-ohm-RF-DSA/121830578745

You can also buy the current version of the Peregrine attenuator chip from Digikey, mount it on a SMD adaptor board and add it to your uBitx IF chain. But, the modules are easier to work with.

These parts have an actual 50 ohm impedance (when the other end is 50 ohm terminated). It might be that the 50 ohms is a bit more load that the IF chain was designed for. 

Tom, wb6b


 


Tom, wb6b
 

On Fri, Apr 19, 2019 at 06:10 AM, Jack Brabham - KZ5A wrote:
looks like the ideal "effector" location for an RX AGC scheme
Hi,

Yes, that looks like it could be a good choice. Just be certain that the power level at that point, on transmit, is within the limits of the attenuator. Off hand I think it is, but there many folks here that may have a more accurate assessment. There have been some issues with Q90 being blown by nearby transmitters and lightning strikes. It may be a good idea to add one of the protection mods, like diodes, that have been suggested in other threads, to protect the attenuator chip input.

I may do the same with my attenuator module, enhance my uBitx, rather than my original reason for buying is as a piece of test equipment. I'll watch your progress.

Tom, wb6b