You are here

ADC +5v and -5v read and compare | Cypress Semiconductor

ADC +5v and -5v read and compare

Summary: 5 Replies, Latest post by Bob Marlowe on 30 Aug 2016 06:21 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
user_491123998's picture
User
72 posts

Hello,

I am using CY8C28445 (PSOC 1) ic . i have to use two ADC . first ADC calculate 5v to 0v and second ADC calculate -5v to 0. 

Both of ADC values i have to compare and turn on two separate  LED light .

ADC1 value  >  ADC2 value = LED 1 turn on 

ADC2 value  >  ADC1 value = LED 2 turn on 

Please provide the sample code for this task . i had test a basic code for +5v to 0 but i am not able to get 0 to -5v value .

 

Best Regards 

Deepak Aagri

user_1377889's picture
User
9835 posts

The input to any pin on your PSoC may not be less than GND. So to measure a voltage < 0V you will have to level-shift it into the range of 0 .. 5V using an R ladder.

 

Bob

user_491123998's picture
User
72 posts

OK .. but i want to calculate multiple ADC value .. how i can switch pot ADC pin to different pin .
i only can use one ADCINC and my requirement is read to 4 input source separate value . is i need to change analogcolumn_inputmux port pin each time of interval to get all 4 channel value . if this is the right way for read multiple ADC value then please let me know how to write a code for multiple ADC read in run time .

 

user_1377889's picture
User
9835 posts

Long time ago that I used that... Use an AMUX4 and configure it for your input pins. Look into datasheet for code example.

Keep in mind that the first 2 ADC samples after switching the mux are invalid.

Consider migrating to a 32 bit processor in a PSoC4. Kits available starting at $10. Including debugging capabilities!!!

 

Bob

user_491123998's picture
User
72 posts

Hi Bob,

Thanks for your advice but  Please share the mux code for  changing the input pin .... 

or tell me below code related to mux input pin change...

 AMUX4_InputSelect(BYTE bChannel);

user_1377889's picture
User
9835 posts

What in the datasheet explanation is unclear?

 

 

Bob

Log in to post new comments.