Processor Expert ADC configuration question...

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Processor Expert ADC configuration question...

跳至解决方案
2,599 次查看
mike1974
Contributor III

Hello everyone,

 

I'm using the ADC component in Processor Expert (found in "CPU Internal Peripherals --> Converter --> ADC").  I don't see any way to configure the ADC to do continuous conversions (instead of just a single conversion) and also hardware averaging.

 

Anyone know how to do this? 

 

Right now I'm having to circumvent P.E, and do my own manual config in the code.  It works, but it's a rather ugly way of doing it because I had to duplicate some P.E. struct definitions in my code.

 

Thank you,

 

--Michael

标签 (1)
0 项奖励
回复
1 解答
1,882 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Michael,

Thanks for the information, I would recommend you to better use the ADC_LDD component:

pastedImage_0.png

You can use the "StartLoopMeasurement" method of this component for a continuous conversion and depending on the number of conversions selected the Hardware Average is enabled/disabled.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,882 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Michael,

Could you tell us which KDS version and MCU are you using?

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 项奖励
回复
1,882 次查看
mike1974
Contributor III

Hi Carlos I am using KDS 2.0.0 and MK22FN1MOVLQ12

0 项奖励
回复
1,883 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Michael,

Thanks for the information, I would recommend you to better use the ADC_LDD component:

pastedImage_0.png

You can use the "StartLoopMeasurement" method of this component for a continuous conversion and depending on the number of conversions selected the Hardware Average is enabled/disabled.

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,882 次查看
mike1974
Contributor III

Great thank you Carlos

0 项奖励
回复
1,882 次查看
rabbitz
Contributor I

Hi Carlos,

If I need do continuous sampling at 20Khz, how can I achieve it?

Use "StartLoopMeasurement" method and timer interrupt at 50uS interval to read the ADC value?

Regards

Sam

0 项奖励
回复
1,882 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Rabbitz,

In your case it would be better to use the "StartLoopTriggeredMeasurement" method and configure the ADC to be triggered by the timer, you can use as reference the "HW triggered conversion of a selected sample group, with interrupt service" example included on the component help:

pastedImage_0.png

pastedImage_2.png

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 项奖励
回复