Processor Expert ADC configuration question...

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Processor Expert ADC configuration question...

Jump to solution
1,767 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,050 Views
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!

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

View solution in original post

0 Kudos
Reply
6 Replies
1,050 Views
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 Kudos
Reply
1,050 Views
mike1974
Contributor III

Hi Carlos I am using KDS 2.0.0 and MK22FN1MOVLQ12

0 Kudos
Reply
1,051 Views
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 Kudos
Reply
1,050 Views
mike1974
Contributor III

Great thank you Carlos

0 Kudos
Reply
1,050 Views
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 Kudos
Reply
1,050 Views
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 Kudos
Reply