cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

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
Reply
8 Replies
Esteemed Contributor II

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
Reply
Anonymous
Not applicable

 Hi

   

Please find attachment

   

pins might be vary

   

thanks

   

dev

0 Likes
Reply
Esteemed Contributor

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
Reply
Esteemed Contributor II

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
Reply
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
Reply
Esteemed Contributor

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
Reply
Anonymous
Not applicable

 Hi 

   

Now it works

   

heartful thanks

0 Likes
Reply
Esteemed Contributor

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
Reply