I am currently using LM397 and the functionality I want is the following.
1] IGN + V1 can have three possibilities, namely, 0V, 12V or 24 Volts.
2] The circuit is expected to give the output either 0 Volts or 3.3Volts.
3] When Pin number 3 (+ input) has voltage less than 3.3V (applied at –ve input) or for that matter any other reference voltage, then I should get 0 Volts.
4] When Pin number 3 has voltage more than the reference voltage, I should get 3.3 Volts.
5] LM397 is an open drain op-amp for me to get the required logic level of 3.3 Volts.
6] Current issue is that the circuit is performing well in all the conditions except when IGN +V1 is 0 volts. In this scenario, when IGN +V1 is 0 volts, it is applied to Pin number 5 and also the positive input, and I am getting 3.3 Volts as output. I expect to see 0Volts and not 3.3 Volts.
7] I need a circuit in which the output of Op-amp is 3.3 Volts when Pin 3 has more voltage than Pin 2, i.e. IGN + V1 is either 12 Volts or 24 Volts, and the output of op-amp is 0 Volts when Pin 3 has 0 volts and IGN +V1 at Pin 5 is 0 volts.
8] Kindly suggest the appropriate circuit and op-amp. Can you please tell me where I am makign a mistake?