AnsweredAssumed Answered

ADC in CTU mode: Which interrupt signals "end of all conversions"?

Question asked by Peter Vranken on Jan 17, 2018
Latest reply on Jan 18, 2018 by Peter Vranken

Dear Ladies and Sirs,


Using the ADCs of the MPC5643L under control of the CTU I have the following question.


In my scenario the CTU demands several AD conversions from both the ADCs. An interrupt is raised after completion of the last conversion. The service routine fetches all conversion results from the data registers of the ADCs and provides them to the application code.


My question: Which interrupt should I configure for fetching the data? I tried to enable the interrupt in the last ADC command submitted by the CTU to the ADC (bit CIR in last used CLRx), but this interrupt came too early (while the CTU initiated conversion was still busy) and fetching the data failed. Prior to enabling CTU control I had applied the ADC conversion chain complete interrupt but under CTU control the ADC has no "chain" configured any more. As a kind of workaround, I programmed a second trigger in the CTU, which comes with constant delay after the start of the ADC command list and which is not connected to the ADC or another device. I use the interrupt on this trigger to do the data fetching. This works fine and it is stable due to the predetermined, SW independent and documented timing of the ADCs. However, I think there should be a more to the point solution, an interrupt, which is really made for saying: "All ADC done"

 

Regards,

Peter

Outcomes