LMS7002M Calibration Help

Hey there ,
I am using a custom board based on LMS7002M . I am trying to do a VCO calibration on the device and I am following the Calibration guide . I am having trouble understanding Modify_SPI_Reg_bits function .

What are the arguments to this function ? For example , Modify_SPI_Reg_bits (0x0121, 10, 3, 0); how would the bits be modified here .

Parameters are: register address, most significant bit, least significant bit, new value.

**Modify_SPI_Reg_bits (0x0121, 10, 3, 0);*:
Reads 0x0121 registers
Clears it value in your selected bits interval ( masks with &= 0xF807)
ORs with your new value shifted by lsb ( |= (0 << 3) )

1 Like

Why does it mask it with 0xF807 ?

It ANDs with 0xF807 to set bits in the interval from 10 to 3 to be set to zeroes. Then it ORs with your new value that you want to write to that interval.

1 Like

@ricardas, Thank you . What register do I check to see if calibration is successfully done for VCO or TX or RX channels .

I suggest you looking at the code: https://github.com/myriadrf/LimeSuite/blob/master/mcu_program/common_src/lms7002m_controls.c#L304

1 Like