Comparator doubt

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

Comparator doubt

861 Views
vinkar
Contributor III

Hello Friends,

I am using the KL04 for BLDC motor control. I want more precise control for state changes in my motor. I was thinking of using the comparator for the same. I want to compare a BEMF voltage from a winding of the motor with the supply voltage. I am looking for the instant the BEMF is almost half of the main supply voltage. Ofcourse, the BLDC is supplied almost 10V , I am stepping that down (volt div) and LPF to acceptable levels for Kinetis.

My point, we need to voltages to the comparator. Can i do the following -

1) Keep the reference voltage as say 3.3V or as in this case half of it or any reference value for that matter. Can i tweak the reference voltage and hard code it or should it always be an input via a pin.

2) Supply the BEMF to the other comparator pin.

3) When the BEMF is half of reference trigger an interrupt.

4) I am using a 24 pin Kinetis KL04. Can I use the Vref for the ADC as the reference voltage of the comparator as well.

Regards,

Vinod.

Labels (1)
Tags (1)
0 Kudos
2 Replies

680 Views
perlam_i_au
Senior Contributor I

Hi vinod:

I read your questions and at this moment I am not pretty sure what you are trying to do, but following your question structure I submit some answers, please tell me if I misunderstand something.

1) Here I understand that you want to know if your signal must come from external pin or if you can get this reference signal internally, here I only know that for CMP you must use external pins to get the signal or use the signal from DAC.

2) You can supply any signal but you must consider electrical specifications for the pin, please review this information in 3.6.2 CMP and 6-bit DAC electrical specifications, I use as example the reference manual KL04P48M48SF1.

3) CMP module will only generate an interruption with rising or falling of the output signal from comparator, you will have to select carefully your signals in order to generate a change on CMP output and then generate a interruption.

4) In fact Vin1=VREFH and also ADC use VREF as reference

Please let me know if I understand your questions and if this information as been useful


Have a nice day,
Perla Moncada

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

634 Views
anup_gandra
Contributor II

Hi perlam,

 

4) In fact Vin1=VREFH and also ADC use VREF as reference

Regarding this Vin1=VREFH ---> Reference manual of says that Vin1 and Vin2 are connected to Vdd. Can i now where can i find about this Vin1=VREFH circuit or any information?

 

cmp_vref.png

 

Thanks in advance,

Anup

0 Kudos