103
Use the Q input of the ADC of Channel 1 to read the difference between on chip
fixed voltage and off-chip voltage.
Compare the ADC value with best value (which is initially set to very high). If
ADC value is lower, then save it as “Best Value”.
3.
Return the “Best Value” found during the sweep.
4.
Calculate and return ratio of “Best Value” to the “Nominal Value”. This ratio is the
calibration value of the resistor for other calibration algorithms to use.
Resistor_calibration
Input Parameters: *ratio
Return Parameters: none
RP_CALIB_BIAS_cal := 16
RP_CALIB_BIAS := 0
RP_CALIB_BIAS (0x0084[10:6]) := RP_CALIB_BIAS
MUX_BIAS_OUT (0x0084[12:11]) := 1
RP_CALIBB_BIAS <= 31 ?
RP_CALIB_BIAS (0x0084[10:6]) := RP_CALIB_BIAS
ADCOUT := RSSI[15:0] (0x040B(15:0))
RP_CALIBB_BIAS == 0 ?
BestValue := ADCOUT
ADCOUT < BestValue ?
BestValue := ADCOUT
RP_CALIB_BIAS_cal := RP_CALIB_BIAS
RP_CALIB_BIAS := RP_CALI 1
NO
END
RP_CALIB_BIAS(0x0084[10:6]) := RP_CALIB_BIAS_cal
ratio := 16/RP_CALIB_BIAS_cal
NO
YES
YES
NO
YES
Initialization
Figure 32 Resistor calibration algorithm
The following is the C code that implements described algorithm:
void Resistor_calibration (float *ratio)
{
unsigned char RP_CALIB_BIAS, RP_CALIB_BIAS_cal;
unsigned short BestValue, ADCOUT;
RP_CALIB_BIAS_cal = 16;
RP_CALIB_BIAS = 0;
Modify_SPI_Reg_bits (0x0084, 10, 6, RP_CALIB_BIAS); // write RP_CALIB_BIAS value
Modify_SPI_Reg_bits (0x0084, 12, 11, 1); // MUX_BIAS_OUT = 1
while (RP_CALIB_BIAS <= 31)
{
Modify_SPI_Reg_bits (0x0084, 10, 6, RP_CALIB_BIAS); // write RP_CALIB_BIAS value
ADCOUT = Get_SPI_Reg_bits(0x040B, 15, 0); //RSSI value
if(RP_CALIB_BIAS == 0)
{
BestValue = ADCOUT;
}
if ( ADCOUT < BestValue )
{
BestValue = ADCOUT;
RP_CALIB_BIAS_cal = RP_CALIB_BIAS; //store calibrated value
}
Содержание LMS7002M Series
Страница 2: ......
Страница 79: ...75 A Ap pp pe en nd di ix x 2 2 Control Block Diagrams ...