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
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
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.
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
I want to check two voltage (0-5)V when one voltage is higher than other logic one should be acheived
regards
deva
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.
Hi
Now it works
heartful thanks
Glad to have been of assistance.
Don'tforget to set the comparator with hysterisis to handle false tripping in
a noisy environment.
Regards, Dana.