CMP- Round Robin in NXP S32K144/142

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

CMP- Round Robin in NXP S32K144/142

978 Views
mrugeshshah
Contributor I

Hello All
I am trying to use CMP in S32k142. I want to use two comparator channels in an alternate fashion (Continuous mode). I thought of using Round Robin method for two channels but then found out we can only trigger Round Robin for CMP in STOP mode. So is there any way or is it possible to trigger it RUN mode?

Labels (1)
3 Replies

823 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi,

As your understatement is right, round robin can be used only in STOP mode.

For your use case I see only one workaround: to implement the round robin in software with CMP module and an additional timer. Based on the overflow interrupt provided by timer you have to change the channel used for comparison and to check if the output value of the CMP matches expected value or not.

Best regards,

Razvan

823 Views
mrugeshshah
Contributor I

Hi, 

Thanks for a quick response. I was doing the same switching the channels based on timer. I have one more question, as you said  output value of the CMP matches expected value or not, it means COUT bit? Is there any way to get input mux analog value which we are passing to comparator.   

0 Kudos

823 Views
razva_tilimpea
NXP Employee
NXP Employee

Hi,

Yes, COUT is the result of the comparison. 

CMP don't convert the analog voltages to digital values. It works like an operational amplifier in open loop.

The only way to get the voltage value for some signals is to use ADC.

Best regards,

Razvan

0 Kudos