TX DC calibration not working


#41

@ricardas
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
DIV_LOCH: 4	 EN_DIV2_DIVPROG: 1
VCO: 6555.23MHz	RefClk: 30.72 MHz
VCOL : csw=0 tune fail
VCOM : csw=0 tune fail
VCOH : csw=0 tune fail
	Selected : VCOH

#42

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.


#43

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.


#44

I meant programming and calibration guide


#45

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?


#46

The calls that produce those calibration error messages are:

LMS_SetLPFBW(device,LMS_CH_TX,0,100e6);
LMS_SetLPFBW(device,LMS_CH_TX,1,8e6);

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.


#47

programming and calibration guide can be found here:
http://www.limemicro.com/wp-content/uploads/2017/07/LMS7002M-Programming-and-Calibration-Guide-v31r05.pdf


#48

great, Thanks!


#49

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.


#50

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?

thanks,
robert


#51

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)


#52

Ricardas,

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.


#53

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


#54

Will do, stay tuned :slight_smile: .


#55

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.


#56

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


#57

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


#58

Hi,

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.