TX DC calibration not working


The CalibrationUpdate branch doesn’t seem to be doing good things for me.Calls to LMS_SetLPFBW produce:

MCU error code(127): Error code undefined

and then trying to set the RX frequency with LMS_SetLOFrequency produces:

Error: SetFrequencySXR(204.851 MHz) - cannot deliver frequency
INT: 102	FRAC: 726903
VCO: 6555.23MHz	RefClk: 30.72 MHz
VCOL : csw=0 tune fail
VCOM : csw=0 tune fail
VCOH : csw=0 tune fail
	Selected : VCOH


Yes, this is wrong. DCWR_* should go after the DC_* value has been written into register.

If you haven’t noticed, the analog DC value writing and reading codes are different, The value is not two’s complement. For reading it’s DC_TXAI[10] - sign, DC_TXAI[9:0] - magnitude as declared in registers datasheet. But for writing format is different, don’t know how to call it or why it’s that way, but that code has been made so that writing value and reading it back would give the same number, and the written value would offset signal as expected.

It’s been a long time since I checked, but now that you mentioned -1024 case I think it probably should not be used, as -1024(two’s complement) could be mapped as DC correction of -0. I’ll need to recheck this one.


Thanks. Which document do you mean by the registers datasheet? I don’t see it in the 7002m datasheet, or in the programming and calibration guide, I haven’t come across any other registers datasheet - but would appreciate it.


I meant programming and calibration guide


This error indicates that either MCU is not programmed, or the algorithm is working way longer than expected.
What filter bandwidth are you trying to set, and was this Rx or Tx?


The calls that produce those calibration error messages are:


so one with 100 MHz BW, the other with 8 MHz, but both give the same error. Replacing the TX with RX produces the same MCU error code(127) messages.

The version of the programming and calibration guide I found (says version 2.24) doesn’t mention TXAI at all. Is there another version of that document? Thanks for the explanation of the bit layout. It all makes a bit more sense.


programming and calibration guide can be found here:


great, Thanks!


One more question for you - On the 0x5C0 register description, it says:

1 – Automatic. In this mode, receiver and transmitter DC offset DACs and
comparators are controlled from addresses 0x05C0–0x05CC. Individual
automatic DC offset calibration routines can be started with control
located in register 0x05C1[7:0] .

But all of the bits of 0x05C1 are marked read-only. I’m guessing it should be 0x5C2 where the DCCAL_START_xxxx bits are. I’ll give those a try.


hi ricardas,

What is the current status of the DC calibration when calling LMS_Calibrate()?

Have the corrections for DC calibration in the Calibration/IUpdate branch been merged into the LimeSuite master branch, or is it still necessary to invoke the register operations described elsewhere in this thread?



Hi, yes the branch has been merged long time ago, calibrations should be working ok.

Not sure what operations you have in mind, but just calling LMS_Calibrate is enough (assuming you already have configured chip to working conditions)



For any TX frequency (145MHz, 2.45GHz) I always get the error “Tx Calibration: MCU error 5 (Loopback signal weak: not connected/insufficient gain?)”.

I am driving TX Channel 1 with IQ almost at the limit, flags = 0. Help greatly appreciated as I see quite bad mirror images and would prefer to use LMS_Calibrate rather than have the user adjust the LMS7Paremeters.

Apart from this I have TX working well in full duplex, really looking very good indeed.


Can you save the chip configuration to file right before LMS_Calibrate(), I would like to see what settings you are using.


Will do, stay tuned :slight_smile: .


Here we go. Error still the same: Settings File.

I do not load a .ini when I start a session, instead start from scratch. I assume there’s a value / register which must be set?

Thanks for helping me,

ETA: This is a Lime USB, transmit frequency 145.8 MHz.


Thanks, calibration was failing because it did not force enable channel B receiver buffers.
Fixed in 42f752af


Ah, thanks. I’ll attack this tomorrow, fast response very much appreciated.



Thanks - calibration works for my configuration. FWIW, I could not compile with VS2013 due to just one issue in Streamer.cpp - VS2013 does not understand sizeof(FPGA_DataPacket::data).

I use VS2013 as some other libraries I must use don’t run in VS2015 or higher. Not a big issue, I changed the code, but i do like to compile all DLLs etc. with VS2013 just for peace of mind.

Again, many thanks.