I'm trying to setup a single channel of an ADC on a FRDM-KL25Z board to use hardware triggering from a PIT (to get periodic samples delivered to an MQX-lite task, but I hope that is not relevant).
I can see my PIT interrupt going off (TU1_OnCounterRestart() is called), but my ADC's OnMeasurementComplete() event is never called.
I have also tried with software triggering instead of the PIT but that does not appear to work either, so I'm pretty sure it's an issue with the ADC.
Any ideas?
Original Attachment has been moved to: Test.zip
Solved! Go to Solution.
Hello Stephen:
Please give a check to the attached project. You were missing some code and enabling a couple of ADC component methods for the HW trigger to work properly.
Let me know if this does not solve the problem.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Stephen:
Please give a check to the attached project. You were missing some code and enabling a couple of ADC component methods for the HW trigger to work properly.
Let me know if this does not solve the problem.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Jorge
I didn't realise that I had to call AD1_SelectSampleGroup() even though I had defined only a single group in PE, nor that I had to call AD1_StartLoopTriggeredMeasurement().
Once that was working it didn't take me long to catch the error of calling AD1_GetMeasuredValues() with the wrong device handle!
Once again, thanks.