cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

AndreaLB
New Contributor

Hi,

I have to compare a Digital output from an ADC with a Digital constant in a Digital comparator. How can i transfer my Digital output from ADC to a Digital comparator?

0 Likes
1 Solution
odissey1
Honored Contributor II

AndreaLB,

One possibility is to use a custom ADC_SAR modified with digital bus output. Attached below is a project showing this approach. 

Attached are project file and ADC_SAR_ex library. Please find library installation instructions below.

/odissey1

 

SAR_ADC_comparator_01a_A.png

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Expert II

A different aproach will be using a DAC and an analog comperator. Will use few resources and does not require interrupts etc. Have a look at the example provided.

Happy coding,

Bob

0 Likes
AndreaLB
New Contributor

Thanks for the answer.

In this case, can i directly take my voltage from the pin and compare it with my max voltage, without using an ADC and a DAC?

 

0 Likes
Bob_Marlowe
Expert II

When your max voltage is an analog input you can compare it to the voltage using the analog comparator. Take care of oscillations at the compare-point.

 

Bob

0 Likes
AndreaLB
New Contributor

Thank you. I really appreciate, you were helpful.

0 Likes
odissey1
Honored Contributor II

AndreaLB,

One possibility is to use a custom ADC_SAR modified with digital bus output. Attached below is a project showing this approach. 

Attached are project file and ADC_SAR_ex library. Please find library installation instructions below.

/odissey1

 

SAR_ADC_comparator_01a_A.png

View solution in original post

0 Likes
AndreaLB
New Contributor

Thank you. You were helpful

0 Likes