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

PSoC™ 5, 3 & 1 Forum Discussions

AndreaLB
Level 1
10 replies posted 10 sign-ins 5 replies posted
Level 1

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
Level 9
First comment on KBA 1000 replies posted 750 replies posted
Level 9

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
Level 10
First like given 50 questions asked 10 questions asked
Level 10

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
Level 1
10 replies posted 10 sign-ins 5 replies posted
Level 1

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
Level 10
First like given 50 questions asked 10 questions asked
Level 10

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
Level 1
10 replies posted 10 sign-ins 5 replies posted
Level 1

Thank you. I really appreciate, you were helpful.

0 Likes
odissey1
Level 9
First comment on KBA 1000 replies posted 750 replies posted
Level 9

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

0 Likes
AndreaLB
Level 1
10 replies posted 10 sign-ins 5 replies posted
Level 1

Thank you. You were helpful

0 Likes