This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

UCD3138: 关于Application Report ZHCA421 – March 2011 UCD3028 数字电源软件设计说明文档的一些问题

Part Number: UCD3138
Other Parts Discussed in Thread: UCD3028

您好,我最近在学习您们的《 UCD3028  数字电源软件设计说明》文档,有些问题不太懂,想向您们请教。

有疑惑的章节如下:

“ 2.4 GUI 软件显示值的转换与实现

1 、显示值算法如下: Io=Io × R15 × 331 × (4096/2.5) × (0.25 × K × 1/216) × 0.25 ,由此可计算出K=15711,因此有如下代码:

#define IOUT_ADC_TO_LITERAL_SCALER_NOMINAL (15711) 

2、函数的具体实现
在函数 pmbus_read_iout_handler()中调用函数 unsigned_short_q_multiply(),并完成数据格式的转换,
如下所示:
temporary = unsigned_short_q_multiply(iout >> 2, K);
pmbus_number_of_bytes = 2;
pmbus_buffer[1] = ((temporary & 0x700) >> 8) + 0x F0;
pmbus_buffer[0] = temporary & 0xff;
而函数 unsigned_short_q_multiply()完成两个输入值的乘积计算并对结果进行转换,如下所示:
product = ((unsigned int) multiplier) * ((unsigned int) multiplicand);
return (signed short)((product + 0x8000) >> 16); //8000 is for rounding”

问题如下:

Q1:显示值算法如下: Io=Io × R15 × 331 × (4096/2.5) × (0.25 × K × 1/216) × 0.25,这个公式的前半部分“Io × R15 × 331 × (4096/2.5)”我能理解,是和调理电路与采样量化有关,但公式的后半部分“ × (0.25 × K × 1/216) × 0.25”,我就不懂了。不知道这些系数是怎么来的,与什么相关,0.25、1/216、0.25这些系数是怎么来的?

Q2:temporary = unsigned_short_q_multiply(iout >> 2, K); 

而函数 unsigned_short_q_multiply()完成两个输入值的乘积计算并对结果进行转换,如下所示:

product = ((unsigned int) multiplier) * ((unsigned int) multiplicand); 
return (signed short)((product + 0x8000) >> 16); //8000 is for rounding”

那么,temporary=(iout/4*K+2e15)/2e16,是这样理解的吧?可是这个temporary 的值是什么意思,感觉和前面的公式对应不上。

这个GUI转换让我很糊涂,麻烦您们指点一二,谢谢!

  • It is very confusing to me as well.  I would ignore those calculations and base the conclusion on the simple equations given in sections 2.1 to 2.3.  Even those are confusing, because they seem to say R15 is .12 milliohms instead of .15.

    Since the ADC value described in Section 2.2 is the same pin as the one in  2.4, it makes no sense that the overall calculation should be different.  

    I think it's probably an error in the app note.  I looked at the source code files I've got here, and I did find one with a 15711 as the constant, but no explanation.  

    I haven't done a sanity check on the correct power of 2, but with my calculation, if I select the power of 2 that has the closest approximation, it gives me a multiplier of 16113.  That is with an R15 of 1.2.  

    I haven't worked that much with that particular code.  Maybe we will get more information this evening from someone in China.  Our expert on this topology, who also speaks Chines, is on vacation this week.  I think he will be back next week.  

    In the meantime, I would suggest not worrying about it too much.  I think the app note is wrong.  

  • Thank you very much!Looking forward to another expert reply。