Merge with master branch.

pull/33/head
guido 2020-10-10 12:02:55 +02:00
commit 4fae69591b
1 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -4,7 +4,11 @@
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<<<<<<< HEAD
#define VERSION "1.02k"
=======
#define VERSION "1.02j"
>>>>>>> master
#define QCX 1 // When not using a uSDX: QCX specific features (QCX, QCX-SSB, QCX-DSP with alignment-feature) (disable this to safe memory)
@ -1092,7 +1096,8 @@ public:
uint16_t d = (16 * fxtal) / fout; // Integer part
if(fout > 30000000) d = (34 * fxtal) / fout; // when fvco is getting too low (400 MHz)
if( (d * (fout - 5000) / fxtal) != (d * (fout + 5000) / fxtal) ) d--; // Test if multiplier remains same for freq deviation +/- 5kHz, if not use different divider to make same
if( (d * (fout - 5000) / fxtal) != (d * (fout + 5000) / fxtal) ) d++; // Test if multiplier remains same for freq deviation +/- 5kHz, if not use different divider to make same
if(d % 2) d++; // even numbers preferred for divider (AN619 p.4 and p.6)
uint32_t fvcoa = d * fout; // Variable PLLA VCO frequency at integer multiple of fout at around 27MHz*16 = 432MHz
msa = fvcoa / fxtal; // Integer part of vco/fxtal
msb = ((uint64_t)(fvcoa % fxtal)*_MSC) / fxtal; // Fractional part
@ -1111,9 +1116,9 @@ public:
SendRegister(42+0*8, ms_regs, 8); // Write to MS0
SendRegister(42+1*8, ms_regs, 8); // Write to MS1
SendRegister(42+2*8, ms_regs, 8); // Write to MS2
SendRegister(16+0, 0x0C|3|0x40); // CLK0: 0x0C=PLLA local msynth; 3=8mA; 0x40=integer division; bit7:6=0->power-up
SendRegister(16+1, 0x0C|3|0x40); // CLK1: 0x0C=PLLA local msynth; 3=8mA; 0x40=integer division; bit7:6=0->power-up
SendRegister(16+2, 0x2C|3|0x40); // CLK2: 0x2C=PLLB local msynth; 3=8mA; 0x40=integer division; bit7:6=0->power-up
SendRegister(16+0, 0x0C|3|0x00); // CLK0: 0x0C=PLLA local msynth; 3=8mA; 0x40=integer division; bit7:6=0->power-up
SendRegister(16+1, 0x0C|3|0x00); // CLK1: 0x0C=PLLA local msynth; 3=8mA; 0x40=integer division; bit7:6=0->power-up
SendRegister(16+2, 0x2C|3|0x00); // CLK2: 0x2C=PLLB local msynth; 3=8mA; 0x40=integer division; bit7:6=0->power-up
SendRegister(165, i * msa / 90); // CLK0: I-phase (on change -> Reset PLL)
SendRegister(166, q * msa / 90); // CLK1: Q-phase (on change -> Reset PLL)
if(iqmsa != ((i-q)*msa/90)){ iqmsa = (i-q)*msa/90; SendRegister(177, 0xA0); } // 0x20 reset PLLA; 0x80 reset PLLB