前言
AD5272 是 Analog 公司的電子可變電阻器。它可以被應(yīng)用在各種電子線路中,進(jìn)行自動參數(shù)設(shè)置和調(diào)節(jié)。AD5272 是一個變阻器(rheostat)兩端器件,而不是電位器(Potentiometer:三端器件)。相對于美國 Xicor 公司的高精度數(shù)字電位器(X9C102,103,104 等),它具有變阻級數(shù)高(1024 級),工作頻帶等特點(diǎn)。
▲ AD5272 數(shù)字變阻器
?
為了對比在博文“寄生電容[1]”對 X9C104 的討論,購買了三片樣品進(jìn)行實驗驗證。
AD5272 簡介
1. 內(nèi)部結(jié)構(gòu)
AD5272 是一款 MSOP 10 管腳封裝的芯片。包括有工作電源、地線,與 MCU 連接的 I2C 接口,以及可變電阻的兩端(A-W)。此外還有一些輔助設(shè)置管腳。詳細(xì)介紹可以參見他的數(shù)據(jù)手冊。下面是 AD5272 的外部管腳以及內(nèi)部結(jié)構(gòu)功能圖。
?
▲ AD5272 內(nèi)部功能圖
?
從上圖可以看出 AD5272 對外的應(yīng)用端口只有兩個(A,W),它是一個變阻器(Varistor:兩端器件)。
2. 產(chǎn)品特性
- 單通道、1024/256 位分辨率標(biāo)稱電阻:20 kΩ、50 kΩ、100 kΩ標(biāo)稱電阻容差誤差:±1%(最大值)50 次可編程(50-TP)游標(biāo)存儲器可變電阻器模式下的溫度系數(shù):5 ppm/℃2.7 V 至 5.5 V 單電源供電雙電源供電:±2.5 V 至±2.75 V(交流或雙極性工作模式)
3. 測試電路板
為了測試 AD5272 的性能,快速制作一塊電路板,將其封裝在電路板上,通過 100mil 的外部引線在面包板上與其它測試電路連接進(jìn)行相關(guān)的測試。
▲ 實驗電路板
?
測試方案
由于 AD5272 的控制是通過 I2C 總線完成的,所以需要借助于一塊 MCU 完成對 AD5272 的數(shù)字控制。下面介紹實驗 MCU 板以及相應(yīng)的軟件開發(fā)。
1. 實驗 MCU 板
實驗電路板 MCU 采用 STC8G1K08 對 AD5272 進(jìn)行控制。該電路板的詳細(xì)介紹在“基于 STC8G1K08 的實驗電路板[2]”中展示。
使用 PK3 端口的 pin6(SCL)和 pin7(SDA)[I2C 總線第四個輸出備選端口],與 AD5275 的 PK3 的 pin4(SCL),pin5(SDA)相連,組成實驗電路。
▲ 8G1K08-SOP16 實驗電路板
?
實際連接線路如下圖所示:
▲ 實驗電路引線連接情況
?
2. 測試軟件
(1) I2C 地址:AD5272 的 7 位地址組成包括兩部分:
- 前 5 位位 :01011 最后兩位是由 ADDR 管腳的電壓確定,具體可以參見下面表格:
ADDR | A1 | A0 | 7-Bit |
---|---|---|---|
GND | 1 | 1 | 0101111 |
VDD | 0 | 0 | 0101100 |
NC | 1 | 0 | 0101110 |
(2)相關(guān)子程序:AD5272 的功能設(shè)置,可以參見其數(shù)據(jù)手冊中的說明。在 CSDN 中給出了 AD5272 接口程序。這些程序上層依賴于 STC8G1K08 的 I2C 操作的函數(shù)支持。
測試結(jié)果
將實驗電路板在面包板上連接,進(jìn)行相關(guān)的性能測試。
▲ 通電后,測試面包板電路
1. 測量 A-W 電阻與設(shè)置參數(shù)之間的關(guān)系
通過軟件設(shè)置 AD5272 中 RDAC 的參數(shù) 0~1023,每次遞增 10,所測量得到的 102 個數(shù)據(jù),測量 A-W 兩端的電阻。實驗數(shù)據(jù)如下:
res=[31.06,195.83,389.87,582.86,786.78,979.69,1173.92,1370.54,1564.31,1756.72,1959.14,2150.80,2342.31,2537.69,2731.21,2923.23,3115.95,3316.69,3506.39,3697.96,3895.03,4088.38,4279.93,4482.23,4672.36,4864.04,5057.67,5251.33,5443.37,5645.82,5836.31,6028.02,6217.46,6411.77,6604.22,6796.99,6997.55,7189.65,7378.69,7569.33,7762.46,7955.59,8156.52,8346.48,8537.97,8723.09,8917.34,9109.66,9302.17,9501.89,9693.09,9871.78,10066.15,10258.58,10450.60,10649.98,10840.70,11027.89,11207.98,11400.64,11592.36,11792.14,11982.23,12169.72,12343.51,12536.54,12726.77,12916.79,13114.53,13303.92,13470.17,13664.16,13855.01,14045.89,14243.87,14432.99,14619.03,14786.59,14978.64,15169.90,15358.20,15556.71,15742.90,15902.01,16094.12,16285.19,16473.98,16670.93,16856.67,17043.42,17202.99,17394.30,17585.01,17773.71,17968.68,18150.75,18303.86,18497.14,18686.51,18873.12,19071.08,19254.32,19397.46]
當(dāng) RDAC=0 時,AW 電阻為 31.06Ω。當(dāng) RDAC=1020 時,AW 電阻為 19397.46Ω。當(dāng) RDAC= 1023 時,AW 電阻最大,為:19516Ω。
設(shè)置 RDAC 值與 AW 電阻之間的曲線為:
▲ AD5272 的電阻與設(shè)置 RDAC 之間的關(guān)系
?
2. ?電阻誤差
分別對設(shè)置為 0,511,1023 三種情況測量 100 次電阻。統(tǒng)計相應(yīng)的均值,標(biāo)準(zhǔn)差。
res0=[30.87,30.86,30.86,30.86,30.85,30.85,30.85,30.85,30.86,30.85,30.86,30.84,30.85,30.84,30.85,30.85,30.85,30.85,30.84,30.85,30.84,30.85,30.84,30.84,30.83,30.84,30.83,30.84,30.83,30.83,30.83,30.84,30.83,30.83,30.83,30.83,30.83,30.83,30.83,30.83,30.83,30.82,30.83,30.83,30.84,30.85,30.83,30.82,30.83,30.83,30.83,30.83,30.84,30.83,30.84,30.83,30.84,30.83,30.84,30.85,30.85,30.85,30.81,30.85,30.85,30.86,30.84,30.84,30.84,30.84,30.83,30.82,30.82,30.82,30.86,30.85,30.82,30.82,30.82,30.82,30.83,30.83,30.82,30.83,30.82,30.82,30.81,30.82,30.81,30.81,30.82,30.81,30.82,30.82,30.82,30.82,30.82,30.82,30.82,30.82]
res511=[9886.59,9885.49,9884.89,9884.65,9884.25,9884.04,9883.44,9883.81,9883.81,9883.98,9883.22,9883.04,9882.73,9882.89,9882.43,9882.25,9882.13,9882.05,9882.12,9882.11,9881.86,9881.92,9881.59,9881.33,9881.01,9881.19,9880.85,9880.63,9880.58,9880.03,9880.37,9880.09,9879.74,9879.86,9879.55,9879.51,9879.57,9879.38,9879.17,9879.23,9879.08,9879.14,9878.99,9879.87,9880.95,9879.46,9879.07,9878.87,9879.52,9879.63,9879.74,9880.59,9878.89,9878.78,9879.26,9879.67,9878.96,9880.50,9879.96,9881.97,9883.24,9880.49,9878.37,9882.40,9878.21,9879.98,9878.29,9881.24,9878.03,9878.41,9877.99,9877.88,9877.75,9882.34,9882.86,9877.51,9877.60,9877.83,9877.64,9877.52,9877.77,9877.57,9877.61,9877.55,9877.38,9877.39,9877.44,9877.50,9877.51,9877.75,9877.60,9877.58,9877.58,9877.56,9877.51,9877.48,9877.47,9877.58,9877.63,9877.56]
res1023=[19474.35,19472.00,19471.12,19468.77,19468.94,19468.57,19469.00,19469.81,19468.81,19470.02,19469.29,19468.49,19467.52,19467.61,19467.82,19466.50,19466.88,19467.17,19467.97,19467.12,19467.38,19467.07,19466.89,19466.63,19466.12,19466.01,19466.00,19465.62,19465.20,19464.87,19465.59,19464.10,19464.87,19464.26,19464.67,19463.29,19464.00,19463.85,19463.87,19464.63,19464.01,19463.51,19464.70,19465.08,19470.97,19464.57,19464.65,19465.02,19466.95,19465.71,19467.71,19471.63,19464.97,19465.42,19468.00,19473.37,19465.89,19470.16,19471.82,19476.47,19480.91,19465.24,19464.30,19472.95,19464.66,19466.91,19464.90,19472.64,19471.20,19466.71,19463.60,19464.15,19463.56,19469.07,19482.30,19463.76,19464.53,19464.39,19464.61,19465.06,19464.63,19464.50,19464.89,19464.03,19464.41,19464.80,19465.25,19464.87,19465.06,19465.52,19465.92,19466.03,19465.40,19466.14,19466.05,19466.48,19466.45,19466.98,19466.42,19466.69]
統(tǒng)計值如下表所示:
統(tǒng)計值 | 設(shè)置 0 | 設(shè)置 511 | 設(shè)置 1023 |
---|---|---|---|
平均值 | 30.83 | 9880.06 | 19466.99 |
標(biāo)準(zhǔn)差 | 0.012977570 | 2.2714 | 3.3832 |
?
將三個測量曲線,減去他們的均值之后,繪制出測量誤差波動曲線:
?
3. 電阻的頻率響應(yīng)
(1)測量原理:
使用 AD9833 模塊產(chǎn)生頻率可變的正弦信號,施加在 R1 與 AD5272 的串聯(lián)電路上。測量輸入電壓與分壓電壓之間的比值隨著頻率的改變和變化的情況,反映了 AD5272 電阻的頻率響應(yīng)特性。
▲ 測量示意圖
?
(2)交流信號源:信號源使用 AD9833 DDS 信號源。通過 ZIGBEE 無線命令設(shè)置它所產(chǎn)生的信號頻率。該模塊的詳細(xì)內(nèi)容參見博文“AD9833 數(shù)字信號發(fā)生器模塊[3]”
▲ AD9833 數(shù)字合成信號發(fā)生模塊
?
設(shè)置頻率所使用的命令為:
ad9833setfrequency xxxx
其中xxxx 設(shè)置頻率數(shù)值。
▲ 組裝后的測試電路
?
(3)測量結(jié)果
在 AD5272 設(shè)置為 511 時,測量信號頻率從 100Hz 到 200kHz 變化時,輸入信號,輸出信號以及它們的比值隨著頻率的變化的情況。
▲ AD5272 設(shè)置為 511 時,分壓電阻的增益頻率曲線
?
測量如下:其中包括輸出電壓 vout,輸入電壓 vin,vout/vin=ratio,以及信號的頻率四組數(shù)據(jù)。
vout=[0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03]
vin=[0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20]
ratio=[0.34,0.34,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.32,0.32,0.32,0.32,0.32,0.31,0.31,0.31,0.31,0.31,0.30,0.30,0.30,0.29,0.29,0.29,0.29,0.28,0.28,0.28,0.28,0.27,0.27,0.27,0.26,0.26,0.26,0.26,0.25,0.25,0.25,0.25,0.24,0.24,0.24,0.24,0.23,0.23,0.23,0.23,0.22,0.22,0.22,0.22,0.22,0.21,0.21,0.21,0.21,0.21,0.20,0.20,0.20,0.20,0.20,0.20,0.19,0.19,0.19,0.19,0.19,0.19,0.18,0.18,0.18,0.18,0.18,0.18,0.18,0.17,0.17,0.17,0.17,0.17,0.17,0.17,0.17,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.15,0.15,0.15]
f=[100.00,2119.19,4138.38,6157.58,8176.77,10195.96,12215.15,14234.34,16253.54,18272.73,20291.92,22311.11,24330.30,26349.49,28368.69,30387.88,32407.07,34426.26,36445.45,38464.65,40483.84,42503.03,44522.22,46541.41,48560.61,50579.80,52598.99,54618.18,56637.37,58656.57,60675.76,62694.95,64714.14,66733.33,68752.53,70771.72,72790.91,74810.10,76829.29,78848.48,80867.68,82886.87,84906.06,86925.25,88944.44,90963.64,92982.83,95002.02,97021.21,99040.40,101059.60,103078.79,105097.98,107117.17,109136.36,111155.56,113174.75,115193.94,117213.13,119232.32,121251.52,123270.71,125289.90,127309.09,129328.28,131347.47,133366.67,135385.86,137405.05,139424.24,141443.43,143462.63,145481.82,147501.01,149520.20,151539.39,153558.59,155577.78,157596.97,159616.16,161635.35,163654.55,165673.74,167692.93,169712.12,171731.31,173750.51,175769.70,177788.89,179808.08,181827.27,183846.46,185865.66,187884.85,189904.04,191923.23,193942.42,195961.62,197980.81,200000.00]
在 AD5272 設(shè)置為 1023 時,測量信號頻率從 100Hz 到 200kHz 變化時,輸入信號,輸出信號以及它們的比值隨著頻率的變化的情況。
▲ AD5272 設(shè)置為 1023 時,分壓電阻的增益頻率曲線
?
測量數(shù)據(jù)為:
vout=[0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02]
vin=[0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20]
ratio=[0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09]
f=[100.00,2119.19,4138.38,6157.58,8176.77,10195.96,12215.15,14234.34,16253.54,18272.73,20291.92,22311.11,24330.30,26349.49,28368.69,30387.88,32407.07,34426.26,36445.45,38464.65,40483.84,42503.03,44522.22,46541.41,48560.61,50579.80,52598.99,54618.18,56637.37,58656.57,60675.76,62694.95,64714.14,66733.33,68752.53,70771.72,72790.91,74810.10,76829.29,78848.48,80867.68,82886.87,84906.06,86925.25,88944.44,90963.64,92982.83,95002.02,97021.21,99040.40,101059.60,103078.79,105097.98,107117.17,109136.36,111155.56,113174.75,115193.94,117213.13,119232.32,121251.52,123270.71,125289.90,127309.09,129328.28,131347.47,133366.67,135385.86,137405.05,139424.24,141443.43,143462.63,145481.82,147501.01,149520.20,151539.39,153558.59,155577.78,157596.97,159616.16,161635.35,163654.55,165673.74,167692.93,169712.12,171731.31,173750.51,175769.70,177788.89,179808.08,181827.27,183846.46,185865.66,187884.85,189904.04,191923.23,193942.42,195961.62,197980.81,200000.00]
在 AD5272 設(shè)置為 100 時,測量信號頻率從 100Hz 到 200kHz 變化時,輸入信號,輸出信號以及它們的比值隨著頻率的變化的情況。
▲ AD5272 設(shè)置為 100 時,分壓電阻的增益頻率曲線
?
測量數(shù)據(jù)為:
vout=[0.11,0.11,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.10,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.08,0.08,0.08,0.08,0.08,0.08,0.08,0.08,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03]
vin=[0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.21,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20,0.20]
ratio=[0.50,0.50,0.50,0.50,0.49,0.49,0.49,0.48,0.48,0.48,0.47,0.47,0.46,0.46,0.45,0.44,0.44,0.43,0.43,0.42,0.41,0.41,0.40,0.40,0.39,0.38,0.38,0.37,0.37,0.36,0.35,0.35,0.34,0.34,0.33,0.33,0.32,0.32,0.31,0.31,0.30,0.30,0.30,0.29,0.29,0.28,0.28,0.28,0.27,0.27,0.27,0.26,0.26,0.26,0.25,0.25,0.25,0.24,0.24,0.24,0.23,0.23,0.23,0.23,0.22,0.22,0.22,0.22,0.22,0.21,0.21,0.21,0.21,0.20,0.20,0.20,0.20,0.20,0.20,0.19,0.19,0.19,0.19,0.19,0.19,0.18,0.18,0.18,0.18,0.18,0.18,0.18,0.17,0.17,0.17,0.17,0.17,0.17,0.17,0.17]
f=[100.00,2119.19,4138.38,6157.58,8176.77,10195.96,12215.15,14234.34,16253.54,18272.73,20291.92,22311.11,24330.30,26349.49,28368.69,30387.88,32407.07,34426.26,36445.45,38464.65,40483.84,42503.03,44522.22,46541.41,48560.61,50579.80,52598.99,54618.18,56637.37,58656.57,60675.76,62694.95,64714.14,66733.33,68752.53,70771.72,72790.91,74810.10,76829.29,78848.48,80867.68,82886.87,84906.06,86925.25,88944.44,90963.64,92982.83,95002.02,97021.21,99040.40,101059.60,103078.79,105097.98,107117.17,109136.36,111155.56,113174.75,115193.94,117213.13,119232.32,121251.52,123270.71,125289.90,127309.09,129328.28,131347.47,133366.67,135385.86,137405.05,139424.24,141443.43,143462.63,145481.82,147501.01,149520.20,151539.39,153558.59,155577.78,157596.97,159616.16,161635.35,163654.55,165673.74,167692.93,169712.12,171731.31,173750.51,175769.70,177788.89,179808.08,181827.27,183846.46,185865.66,187884.85,189904.04,191923.23,193942.42,195961.62,197980.81,200000.00]
將上面三組增益曲線繪制在同一張圖中:
▲ 增益隨著頻率變化曲線
?
結(jié)論
通過對 AD5272 的檢測測試,驗證了它作為可變電阻的基本特性。特別是動態(tài)特性,可以滿足一般音頻信號的放大與調(diào)節(jié)。
?
參考資料
[1]寄生電容: https://zhuoqing.blog.csdn.net/article/details/104134132
[2]基于 STC8G1K08 的實驗電路板: https://zhuoqing.blog.csdn.net/article/details/105612710
[3]AD9833 數(shù)字信號發(fā)生器模塊: https://zhuoqing.blog.csdn.net/article/details/104112884