OK, here's some C code that should correctly keep our signal of interest centered
in both the 45mhz and 12mhz crystal filters, avoiding Gerald's problem of USB
sounding different than LSB.? This was a thread about Gerald's problem, right?
The variable pbt stands for PassBandTuning, and allows the user to?
adjust how far from the 12mhz filter the BFO will be, as discussed in the last
dozen or so posts.??
######################################################
// Initialized to typical values, can be configured by the user
uint32_t? f45c? = 44995000;? ? ?// center of 45mhz filter
uint32_t? f12c? = 11998000;? ? ?// center of 12mhz filter
uint32_t? pbt? ?=? ? ?1500;? ? ?// bfo is 1500 hz below f12c
char? ? ? isUSB = 0;
?
// Compute these values:
uint32_t? bfo, clk1, vfo;
?
// ftune is the freq in hz we want the rig tuned to
void do_tune(uint32_t ftune) {
? bfo = f12c - pbt;
? if (isUSB)? {
? ? // For USB, ftune = vfo-(clk1-bfo)
? ? clk1 = f45c + f12c;
? ? vfo =? ftune + (clk1-bfo);
? } else {
? ? // For LSB, ftune = vfo-(clk1+bfo)
? ? clk1 = f45c - f12c;
? ? vfo =? ftune + (clk1+bfo);
? }
}
#######################################
Jerry, KE7ER