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
Solved! Go to Solution.
Hi Michael,
Thanks for the information, I would recommend you to better use the ADC_LDD component:
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Michael,
Could you tell us which KDS version and MCU are you using?
Best Regards,
Carlos Mendoza
Technical Support Engineer
Hi Carlos I am using KDS 2.0.0 and MK22FN1MOVLQ12
Hi Michael,
Thanks for the information, I would recommend you to better use the ADC_LDD component:
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!
-----------------------------------------------------------------------------------------------------------------------
Great thank you Carlos
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
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:
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer