I am getting calibration errors: MCU error 2 (CGEN tune failed). CGEN is 393.216 MHz, I am performing calibration as part of the transmit initialisation. the radio is set to 145 MHz for transmit.
Calibrating the receiver with CGEN = 320MHz is OK.
Just tried on my LimeSDR, it works ok, all settings also looks good.
During calibration the actual CGEN frequency that is being tuned is 414,72 MHz. I suggest try to set CGEN frequency to 414,72 MHz using LimeSuiteGUI to see if it succeeds to tune it there.
The calibration algorithm internally changes CGEN frequency from your 393.216 MHz to nearest multiple of 46.08 MHz (which is 414.72 MHz).
I’m suggesting to use LimeSuiteGUI as it would be easier to check what’s going on if the frequency fails.
If it fails, try to increase “Scales VCO bias current” and try again. if it succeeds with the initial value, then check how wide is the CSW_VCO_CGEN locking range, while changing CSW_VCO_CGEN value look at VCO comparators, at which point their values become different from High:1 Low:0
This assumes I know what the LimeSuiteGUI is doing, which I don’t. As the API returns an error message I need to find out how to resolve this error, determine whether it’s my hardware or a parameter which needs to be set.
In the above window I don’t see a Calibrate button.
In summary - if I am to support TX on the Lime-USB then I must be able to understand the errors generated by the library and provide meaningful responses to users, the vast majority will not understand LimeSuiteGUI (I don’t know what it’s doing).
I’ve tried your configuration, parameters are good and it should work. I suspect this could be some hardware nuance, the only reason why CGEN tune could fail would be if the VCO cannot achieve desired frequency. To know for sure those marked parameters would have to be tested, there seems to be no direct way to manipulate CGEN tuning using API without being affected by other settings.
Try this:
Open LimeSuiteGUI
At the top Click Options->Connection settings, and connect to the board
At the top Click Open, select your configuration file that you attached here
Switch to CLKGEN tab
near the center top part, there is “Frequency controls”, change CLK_H(MHz) to 414.72
Click “Calculate” button
If it fails and shows any error, then it’s a hardware issue and would need further investigation to see if it could be worked around on your board.
This I now understand and it worked correctly in LimeSuiteGUI. I expect this is an error in the sequence of commands used in my code to start the TX stream, I’ve looked at the samples and don’t see a difference. One thing i see in the diagnostics is: SetPllFrequency: error configuring phase when calling LMS_Init().
Back to CGEN - here’s a logfile with the same processing, here we have level 1 and level 4 diagnostics. Maybe this helps, I don’t know. I will now try with RX and TX sample rates at 3.072 MHz, at the moment I have different sample rates.
Maybe I should use channel 0 at 10 MHz for receive, and channel 1 at 3.072 MHz for transmit.