Hello everybody,
I need to modify the .quisk_conf.py file in order to control the Si570BBB of my QRP2000 generator by sdr-kits.net https://www.sdr-kits.net/QRP2000-kits
I want to use the QRP2000 generator for a simple downconversion receiver with a 10.712 intermediate frequency (no quadrature).
Which lines should I add before the usual soundcards lines in the .quisk_conf.py file ?
Franco iz2oos
|
Hi Franco,
I'm not sure to understand the problem, could you explain a bit more what you want to achieve?? Do you want to tune the SI570 VFO from Quisk, with a certain IF frequency offset? Do you want to tune the SI570 via USB or via I2C??
I think such functionality should be implemented in the Quisk hardware file, see the documentation for "ChangeFrequency(self, tune, vfo, source='', band='', event=None)". I did that with I2C control of the SI570. For USB control of the SI570 look in the softrock folder, file?hardware_usb.py; but I have no experience with it.
vy 73 de Yves, hb9ewy
|
Hi Yves,
Do you want to tune the SI570 VFO from Quisk, with a certain IF frequency offset? Yes, exacty, eg 3.650(frequency to display on Quisk)+10.712 (IF)=14.362 (frequency of the QRP2000 signal generator)
Do you want to tune the SI570 via USB or via I2C? In the QRP2000 (SI570) signal generator an Atmel ATTiny85 Micro-ControllerATMEL connects to the PC via the USB port.
I have checked the ?hardware_usb.py in the configuration menu and set the IF in Bands as if the IF were a transverter but no luck. In Softrocks I believe the frequency is multiplied by 4 to tune, here I would just need a simple VFO (I don't even need I and Q), something that is more basic.
Il luned¨¬ 21 febbraio 2022, 04:29:18 CET, roschi_ch <yves@...> ha scritto:
Hi Franco,
I'm not sure to understand the problem, could you explain a bit more what you want to achieve?? Do you want to tune the SI570 VFO from Quisk, with a certain IF frequency offset? Do you want to tune the SI570 via USB or via I2C??
I think such functionality should be implemented in the Quisk hardware file, see the documentation for "ChangeFrequency(self, tune, vfo, source='', band='', event=None)". I did that with I2C control of the SI570. For USB control of the SI570 look in the softrock folder, file?hardware_usb.py; but I have no experience with it.
vy 73 de Yves, hb9ewy
|
Ciao Franco
I can't help you with the USB control of the SI570, I never used that interface.
Below you'll find some sections of my Quisk HW file which were modified to use an 9MHz IF with the 2m Transverter to the 20m band.? They are ment for inspiration. The radio also has an rotary encoder for tuning (read vie GPIO), so you don't need the related code. The 2 functions??ChangeFrequency and?ReturnFrequency are the the ones you need to adapt - read Jim's documentation about them.
from Rotary.rotary_class import RotaryEncoder from pyrpio.i2c import I2C from pyrpiic.clock.si570 import SI570
??? self.tune_freq = 0??? ??? # keep track of tune frequency by rotary encoder *** ??? self.tuned_extern = 0??? # flag, true indicates that an external tuning is pending, LO must be changed ??? self.if_freq = 8.999*1.0E6??? # IF frequency for use with mixing frontend, depends on filter, for USB ??? self.lo_freq = 0.0??? ??? # frequency of the local oscillator ??? self.lo_div = 8??? ??? # divider of the lo signal
??? # Make instance for si570 ??? # Create and open I2C-1 bus ??? self.i2c1 = I2C('/dev/i2c-1') ??? self.i2c1.open() ??? # Create clock ??? self.clock = SI570(self.i2c1, 0x55)
? def ChangeFrequency(self, tx_freq, vfo_freq, source='', band='', event=None): ??? if tx_freq and tx_freq > 0: ????? self.tx_frequency = tx_freq ????? self.tune_freq = tx_freq # keep track of the new tune frequency *** ????? tx = int(tx_freq - self.transverter_offset) ????? if self.band == '2': tx = int(self.if_freq) # *** fix tx frequency for 2m band, on the IF of about 9MHz ????? self.pc2hermes[ 4] = tx >> 24 & 0xff??? ??? # C0 index == 1, C1, C2, C3, C4: Tx freq, MSB in C1 ????? self.pc2hermes[ 5] = tx >> 16 & 0xff ????? self.pc2hermes[ 6] = tx >>? 8 & 0xff ????? self.pc2hermes[ 7] = tx?????? & 0xff ????? if self.band == '2': #adjust the LO si570 to the correct frequency from IF frequency to the 20m band ??????? self.lo_freq = self.lo_div * (tx_freq - self.transverter_offset - self.if_freq) ??????? if DEBUG: print("LO freq:", self.lo_freq) ??????? self.clock.set_frequency_smooth(self.lo_freq)? ??? # ---> here the SI570 VFO gets tuned ??? if self.vfo_frequency != vfo_freq: ????? self.vfo_frequency = vfo_freq ????? vfo = int(vfo_freq - self.transverter_offset) ????? self.pc2hermes[ 8] = vfo >> 24 & 0xff??? ??? # C0 index == 2, C1, C2, C3, C4: Rx freq, MSB in C1 ????? self.pc2hermes[ 9] = vfo >> 16 & 0xff ????? self.pc2hermes[10] = vfo >>? 8 & 0xff ????? self.pc2hermes[11] = vfo?????? & 0xff ??? if DEBUG >1: print("Change freq Tx", tx_freq, "vfo:", vfo_freq, " ", "tx:", tx) ??? QS.pc_to_hermes(self.pc2hermes) ??? return tx_freq, vfo_freq
?
?def ReturnFrequency(self):??? # Return the current tuning and VFO frequency ??? if self.tune_freq == 0 or self.tuned_extern == 0: ????? return None, None #frequencies have not changed / start ??? elif self.band == '2': ????? self.lo_freq = self.lo_div * (self.tune_freq - self.transverter_offset - self.if_freq) ????? if DEBUG: print("LO freq:", self.lo_freq) ????? self.clock.set_frequency_smooth(self.lo_freq)?? # ---> here the SI570 VFO gets tuned ????? self.tuned_extern = 0 ????? return self.tune_freq, self.vfo_frequency # because tuning by rotary encoder *** ??? elif self.tuned_extern >0 : ????? self.tuned_extern = 0 ????? return self.tune_freq, self.vfo_frequency # because tuning by rotary encoder *** ??? else: ????? return None, None
Try to separate the different tasks and proceed and integrate in small steps which could be tested independently. e.g. first implement and test the SI570 control from Python, then?calculate the needed LO frequency and print it out to see whether the LO tracks correctly, etc.
vy 73 de Yves, hb9ewy
|
Hi everybody, thanks for the inputs. Reading the following link things are a little bit clearer:
SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="05dc", MODE="0666", GROUP="dialout"
and checked for the the generated frequency typing:
rigctl -vvvvv -m 2509 get_freq
Now I know that I can change the frequency via Quisk configuration menu: the only problem is the frequency is multiplied by 4: eg. 3.600Mhz is 14.400Mhz and using the Xverter offset (for my intermediate frequency) in the menu it becomes messy as the offset is also multiplied by 4. However after some math I was able to tune to the 80m band. So what I only need is to divide the frequency by 4 and setting a correct frequency offset for my intermediate frequency. I still think that adding a few lines in the .quisk_conf.py lines would be the easiest way.?
Il luned¨¬ 21 febbraio 2022, 22:35:07 CET, roschi_ch <yves@...> ha scritto:
Ciao Franco
I can't help you with the USB control of the SI570, I never used that interface.
Below you'll find some sections of my Quisk HW file which were modified to use an 9MHz IF with the 2m Transverter to the 20m band.? They are ment for inspiration. The radio also has an rotary encoder for tuning (read vie GPIO), so you don't need the related code. The 2 functions??ChangeFrequency and?ReturnFrequency are the the ones you need to adapt - read Jim's documentation about them.
from Rotary.rotary_class import RotaryEncoder from pyrpio.i2c import I2C from pyrpiic.clock.si570 import SI570
??? self.tune_freq = 0??? ??? # keep track of tune frequency by rotary encoder *** ??? self.tuned_extern = 0??? # flag, true indicates that an external tuning is pending, LO must be changed ??? self.if_freq = 8.999*1.0E6??? # IF frequency for use with mixing frontend, depends on filter, for USB ??? self.lo_freq = 0.0??? ??? # frequency of the local oscillator ??? self.lo_div = 8??? ??? # divider of the lo signal
??? # Make instance for si570 ??? # Create and open I2C-1 bus ??? self.i2c1 = I2C('/dev/i2c-1') ??? self.i2c1.open() ??? # Create clock ??? self.clock = SI570(self.i2c1, 0x55)
? def ChangeFrequency(self, tx_freq, vfo_freq, source='', band='', event=None): ??? if tx_freq and tx_freq > 0: ????? self.tx_frequency = tx_freq ????? self.tune_freq = tx_freq # keep track of the new tune frequency *** ????? tx = int(tx_freq - self.transverter_offset) ????? if self.band == '2': tx = int(self.if_freq) # *** fix tx frequency for 2m band, on the IF of about 9MHz ????? self.pc2hermes[ 4] = tx >> 24 & 0xff??? ??? # C0 index == 1, C1, C2, C3, C4: Tx freq, MSB in C1 ????? self.pc2hermes[ 5] = tx >> 16 & 0xff ????? self.pc2hermes[ 6] = tx >>? 8 & 0xff ????? self.pc2hermes[ 7] = tx?????? & 0xff ????? if self.band == '2': #adjust the LO si570 to the correct frequency from IF frequency to the 20m band ??????? self.lo_freq = self.lo_div * (tx_freq - self.transverter_offset - self.if_freq) ??????? if DEBUG: print("LO freq:", self.lo_freq) ??????? self.clock.set_frequency_smooth(self.lo_freq)? ??? # ---> here the SI570 VFO gets tuned ??? if self.vfo_frequency != vfo_freq: ????? self.vfo_frequency = vfo_freq ????? vfo = int(vfo_freq - self.transverter_offset) ????? self.pc2hermes[ 8] = vfo >> 24 & 0xff??? ??? # C0 index == 2, C1, C2, C3, C4: Rx freq, MSB in C1 ????? self.pc2hermes[ 9] = vfo >> 16 & 0xff ????? self.pc2hermes[10] = vfo >>? 8 & 0xff ????? self.pc2hermes[11] = vfo?????? & 0xff ??? if DEBUG >1: print("Change freq Tx", tx_freq, "vfo:", vfo_freq, " ", "tx:", tx) ??? QS.pc_to_hermes(self.pc2hermes) ??? return tx_freq, vfo_freq
?
?def ReturnFrequency(self):??? # Return the current tuning and VFO frequency ??? if self.tune_freq == 0 or self.tuned_extern == 0: ????? return None, None #frequencies have not changed / start ??? elif self.band == '2': ????? self.lo_freq = self.lo_div * (self.tune_freq - self.transverter_offset - self.if_freq) ????? if DEBUG: print("LO freq:", self.lo_freq) ????? self.clock.set_frequency_smooth(self.lo_freq)?? # ---> here the SI570 VFO gets tuned ????? self.tuned_extern = 0 ????? return self.tune_freq, self.vfo_frequency # because tuning by rotary encoder *** ??? elif self.tuned_extern >0 : ????? self.tuned_extern = 0 ????? return self.tune_freq, self.vfo_frequency # because tuning by rotary encoder *** ??? else: ????? return None, None
Try to separate the different tasks and proceed and integrate in small steps which could be tested independently. e.g. first implement and test the SI570 control from Python, then?calculate the needed LO frequency and print it out to see whether the LO tracks correctly, etc.
vy 73 de Yves, hb9ewy
|
Hi Yves and everybody,
I managed it! Indeed I changed two lines in the "hardware_usb.py" file. The QRP2000 signal generator essentially in Quisk connects to the PC via the USB port like Softrock, but in the "hardware_usb.py" file there are two lines containing " * 4 ", and that is where the frequency is multiplied by 4. Removing the * 4 the QRP2000 to generate the frequency 3.5Mhz actually generates 3.5Mhz and not 14Mhz (= 3.5Mhz * 4) anymore. Then regarding the 10.7Mhz offset, it's trivial as I use the transverter option in the menu of Quisk in "bands" (just like Softrock) and to receive a 3.5Mhz with a 10.7Mhz intermediate frequency I set the offset to "- 10700000". It's very simple! The terminal command rigctl -vvvvv -m 2509 get_freq was very useful to check the generated frequency.
That's all, thank you! And I hope other QRP2000 owners will be using Quisk!
Franco iz2oos
|
Hi Franco,
According to Your advice I also tried to change the two instances in the hardware_usb.py? file "* 4" => "* 1" but with no change in the output frequency from my Softrock type of rig, still multiplied by four. The offset worked as expected, though. I am not sure if I got your advice right, please verify my interpretation ! What I am trying to do is to control my Si590 freq generator with some software running under Linux, for Windows the are plenty and in particular, CFGSR in which You can specify whether the output freq is multiplied or not. Something similar for Linux would be nice, but since I have used Quisk with my HermesLite rigs for years, it it a good candidate for me.
73 de Heikki (OH2LZI)
|
Hi Heikk1, I still keep all that old stuff around. in one of the subdirectories there.
#./usbsoftrock --help ./usbsoftrock: invalid option -- '-' usbsoftrock 1.0 usage: ./usbsoftrock [OPTION] COMMAND
OPTION is one or more of ?-a ????????????????????????????Advanced firmware present ????????????????????????????????i.e. let the firmware calculate registers ?-d ????????????????????????????Enter a mode that listens for commands via UDP. ?-i <address> ??????????????????I2C address in DECIMAL (DEFAULT = 85 (0x55)) ?-m <multiplier> ???????????????Multiplication factor for frequency (DEFAULT = 4) ?-p <port num> ?????????????????Port to listen for UDP datagrams (DEFAULT = 19004) ?-s <startup frequency MHz> ????Factory programmed startup frequency (DEFAULT = 56.32) ?-v ????????????????????????????Verbose output (fairly useful) ?-vv ???????????????????????????Even more verbose output (debugging) ?-x <calibrated xtall freq MHz> Corrected XTALL frequency of Si570 device calculated ????????????????????????????????through the use of the calibrate command immediately ????????????????????????????????after startup. COMMAND is one of ?calibrate (may require -s option) ?getfreq ?getregisters ?interactive ?ptt {on|off} ?set bpf {on|off} ??????????????????????(PE0FKO+TF3LJ+Mobo) ?set bpf_addr <band> <filter> ??????????(PE0FKO >= 15.12+Mobo ?set bpf_point <crossover> <f in MHz> ??(PE0FKO+TF3LJ+Mobo) ?set lpf {on|off} ??????????????????????(TF3LJ+Mobo only) ?set lpf_addr <band> <filter> ??????????????????" ?set lpf_point <crossover> <f in MHz> ??????????" ?set freq <frequency in MHz> ?set si570_addr <i2c address in decimal> ?set si570_multiplier [band] <decimal factor> ?(PE0FKO>=15.12+Mobo) ?set startup <frequency in MHz> ????????(PE0FKO+TF3LJ+Mobo) ?set xtall <frequency in MHz> ??????????(PE0FKO+TF3LJ+Mobo) ?status
?where TF3LJ = Lofturs AtMega168 derivative ???????Mobo ?= Mobo 4.3 Project AT90USB162 Firmware ------------------------------------------------------------------------------- 73 ... Sid.
toggle quoted message
Show quoted text
On 20/04/2023 13:54, Heikki Ahola wrote: Hi Franco,
According to Your advice I also tried to change the two instances in the hardware_usb.py? file "* 4" => "* 1" but with no change in the output frequency from my Softrock type of rig, still multiplied by four. The offset worked as expected, though. I am not sure if I got your advice right, please verify my interpretation ! What I am trying to do is to control my Si590 freq generator with some software running under Linux, for Windows the are plenty and in particular, CFGSR in which You can specify whether the output freq is multiplied or not. Something similar for Linux would be nice, but since I have used Quisk with my HermesLite rigs for years, it it a good candidate for me.
73 de Heikki (OH2LZI)
-- Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support Senior Staff Specialist, Cricket Coach Microsoft Windows Free Zone - Linux used for all Computing Tasks
|