ConfigTools bug about ADC sampling time

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

ConfigTools bug about ADC sampling time

ソリューションへジャンプ
2,930件の閲覧回数
stefano-quantic
Contributor III

In ConfigTools inside MCUXpresso, I add a "Peripheral driver" (specifically for LPADC2, on an iMXRT1176; I don't know if the bug is specific to this).
In the "Conversion command configuration", I can select "Sample time mode". These are the available choices: 3, 5, 7, 11, 19, 35, 69, 131.
However, according to the reference manual (IMXRT1170RM Rev. 2, 06/2023, pp. 6170), the sampling times are in the form (3.5 + 2**STS), so they should be 3.5, 5.5, 7.5, 11.5, 19.5, 35.5, 67.5, 131.5
Notice in particular that 69 should actually be 67.5; all the others are off by 0.5.
This is a GUI-only problem: the generated code has the correct constants (kLPADC_SampleTimeADCK67).
The bug extends to the automatically-calculate "Sample time" that is shown in the GUI, right below the "Sample time mode" dropdown box; this value is calculated using the wrong value 69 instead of 67.5.
Also, the bug extends to the comments in fsl_lpadc.h:

 

 

typedef enum _lpadc_sample_time_mode
{
kLPADC_SampleTimeADCK3 = 0U, /*!< 3 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK5 = 1U, /*!< 5 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK7 = 2U, /*!< 7 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK11 = 3U, /*!< 11 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK19 = 4U, /*!< 19 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK35 = 5U, /*!< 35 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK67 = 6U, /*!< 69 ADCK cycles total sample time. */
kLPADC_SampleTimeADCK131 = 7U, /*!< 131 ADCK cycles total sample time. */
} lpadc_sample_time_mode_t;

 

 

Here, too, the value is 69 instead of 67.5, and the others lack the .5

Incorrect information is also present in the latest reference manual (rev2; §87.3.5 "Sample time, compare time, and total conversion time", p.6129):
Sample time interval = (3+2**STS)*adc_clk

 

I'm using MCUXpresso IDE v11.7.0 [Build 9198] [2023-01-17].

I didn't see any fix about this in the latest 11.7.1 version (https://community.nxp.com/t5/MCUXpresso-IDE-Knowledge-Base/MCUXpresso-IDE-v11-7-1-Now-Available/ta-p...), nor in ConfigTools (https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/Config-Tools-for-i-MX-v13-1-Now-Availabl...)

0 件の賞賛
返信
1 解決策
2,180件の閲覧回数
RaRo
NXP TechSupport
NXP TechSupport

Hello @stefano-quantic,

First of all, we apologize for the delay.

After double check the information, we have obtained the following: "The table listed is correct, but the equation needs to be updated to match the table. It should be 3.5+2^STS instead of 3+2^STS."

Finally, this issue has been reported to the documentation team for a future update.

Thanks again for your feedback.

Best regards, Raul.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,181件の閲覧回数
RaRo
NXP TechSupport
NXP TechSupport

Hello @stefano-quantic,

First of all, we apologize for the delay.

After double check the information, we have obtained the following: "The table listed is correct, but the equation needs to be updated to match the table. It should be 3.5+2^STS instead of 3+2^STS."

Finally, this issue has been reported to the documentation team for a future update.

Thanks again for your feedback.

Best regards, Raul.

0 件の賞賛
返信
2,130件の閲覧回数
stefano-quantic
Contributor III

Thanks @RaRo 

Also: §87.3.5 (in the reference manual) suggests that a value STS=0 corresponds to a setting 3.5+2**STS = 3.5+2**0 = 3.5+1 = 4.5
The register description in §87.7.1.14.4, instead, states that STS=0 is a special case; the formula doesn't apply here, and the setting is 3.5 (which is in line with the SDK naming, barring the .5 error).
So, I guess the correct setting for STS=0 is 3.5

0 件の賞賛
返信
2,044件の閲覧回数
RaRo
NXP TechSupport
NXP TechSupport

Hello @stefano-quantic,

You are right, according to Section 87.7.1.14., the formula doesn't apply if you use a zero value for STS. In this case the table mentions the value of 3.5 for STS [000].

Best regards, Raul.

0 件の賞賛
返信
2,908件の閲覧回数
RaRo
NXP TechSupport
NXP TechSupport

Hello @stefano-quantic,

Let us double check which information of i.MX RT1170 Processor Reference Manual is the right one (3+2**STS or 3.5+2**STS) to give you a more proper answer.

In the meantime, we will let the team in charge to know about this for upcoming updates. Either to modify the RM or the SDK and ConfigTools.

Thanks for the feedback.

Best regards, Raul.

0 件の賞賛
返信