- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What in the datasheet explanation is unclear?
Bob