Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can we use ADC as a voltage comparator??????????????????

Status
Not open for further replies.

s3034585

Full Member level 4
Joined
May 24, 2004
Messages
226
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Activity points
2,087
Hi Guys
I am using MCF5282 micro controller for my project. This micro controller has a inbuilt ADC with 8 input ports, a reference high and low. Can i use these adc pins to implement a window comparator in the software. The board is having 3.3 and 5v supply. inorder to implement a window comparator i need to set a ref high and low value for comparision. But this adc has only 1 ref high and low port. So in this how can i implement this. Can i use the rest of the analog inputs as ref high and low inputs and make the software compre the diff voltages internaly. IF so can any one pls suggest how to do this...

thanks in advance
tama
 

You only need one reference. If you are going to use an external reference, and I strongly recommend you do, then connect it between VREF+ and VREF-. Actually VREF- is ground, but make sure you connect it to ground right at the ground pin of your reference, to eliminate any voltage drops across traces in the ground.
Make sure you set up the ADC registers to use the external reference.

The comparison is done completely in S/W:
Measure one channel.
Compare the result (a number) with your upper and lower limit (again numbers). Decide what you do in each case. The comparison is usualy done by subtracting one number from the other and checking the carry bit if it is set or not.
That tells you if the result of the subtraction was negative or positive, which means the input you were looking at was either below or above the threshold. Jump to a subroutine or other part of the code based on the result of the comparison, or do whatever is required.

Continue for the other channels in the same manner.

It is easier to do the subtraction on only 8 bits, if the requirements allow lower resolution. If possible, set up the ADC to left-justify the result.
 

    s3034585

    Points: 2
    Helpful Answer Positive Rating
Hi VVV

Thanks a lot for ur reply. ur opinion is quite helpfull...

thanks again
tama
 

Look here :

**broken link removed**

or look at AN700 from Microchip
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top