FRDM-KL25Z ADC OnMeasurementComplete() never gets called

cancel
Showing results for 
Search instead for 
Did you mean: 

FRDM-KL25Z ADC OnMeasurementComplete() never gets called

Jump to solution
360 Views
stephenlangstaf
Contributor III

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

1 Solution
154 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
155 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

154 Views
stephenlangstaf
Contributor III

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.