Comparator

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi

   

i want to design a comparator for my PSOC5LP device,Today i tried with comparator block with two analog input port and one digital output port but i am not getting any output

   

1.I tried with giving two analog inputs through pin P4.7 and P4.6 and taking output in P0.2 but nothing happens

   

2.I didn't write any code whether code is necessary 

   

example provided also for PSOC4 that is also not working

0 Likes
8 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In cases like yours it is always advisable to post the complete project so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.



Bob
 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Hi

   

Please find attachment

   

pins might be vary

   

thanks

   

dev

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Virtually all components have to be started -

   

 

   

Comp_Start();

   

 

   

What is the range of the input signals you are dealing with. In voltage ?

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

All (nearly all) components need an initialization using a Start() function. This applies the settings made in the configuration and powers the component. So you have the opportunity when running on a battery to reduce power usage for components by calling a Stop() or a Sleep() function.

   

So I inserted a Comp_1_Start() call and now it should work perfectly. Project attached.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 I want to check two voltage (0-5)V when one voltage is higher than other logic one should be acheived

   

regards

   

deva

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Unfortunately the input CM range is limited to -

   

 

   

   

 

   

So you will have to divide down the Vin+ and Vin- to accomidate that. Simple

   

R dividers will accomplish that. I would suggest you use the Vref = Vdd / 2 for

   

the - input, and an equal R divider on the other. You will have to worst case the

   

design to establish range of trip values.

   

 

   

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Hi 

   

Now it works

   

heartful thanks

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Glad to have been of assistance.

   

 

   

Don'tforget to set the comparator with hysterisis to handle false tripping in

   

a noisy environment.

   

 

   

Regards, Dana.

0 Likes