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.

[SOLVED] Compare Analog Input in PIC18F452

Status
Not open for further replies.

Stavros84

Junior Member level 2
Joined
Dec 7, 2010
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,291
Activity points
1,439
Hello
I want to give an analog input to pic18F452 by a temperature sensor or potentiometer. From the curve of the analog input i will find the equation. After that i will find the inverse of this equation and i will store it to the pic. And finally i want to compare the input signal with the result of the inverse equation and store it to an external memory and then send it to a DAC.

Does anyone know how i can compare it?
 

You should have asked it little bit clearer.. I hope you have already found the answer..
 

Hello exnol
I want to make something like this (see the 1st page)
I will try again to find the solution with those thinks that i read in this web site and if i will not find the solution, i will try to explain it better.
 

It is more of a programming problem, than analog, I would have thought. You have an ADC in the PIC so you digitise it and either calculate the required output or use a lookup table. You will need an external DAC for the output.

Keith.
 

Hello Keith
Yes i have an ADC in the PIC so i digitize the analog input and calculate with pic the inverse of input signal. I store the output at lookup table and the i send it to an external DAC for the output. Something like the example in the link.

I have made some test today. I think that it work but with a lot of problem. The output is not a triangle like figure 3 of the web site, or it not like the figure 6.

I will make more tests tomorrow. Maybe i have problem when i store (save the output of the pic) at the lookup table.
 

Try a simple lookup table first (straight line with a slope of -1 for example) it will be easier to debug.

Keith
 

OK Keith thank you very much.
Here is a photo from the results that i had take today.

DAC output.JPG
 

It is tricky to be certain of what I am actually looking at, but you seem to have a straight line for the first quarter of the waveform - is that what you expected?

Keith
 

I think so that it should be straight line (diagonal )like the first quarter or it should have small steps like the figure 6
I don't understand why after the first quarter it go down to 0 Volt and the return back to continue the line. This think i will try to solve tomorrow.

I was wondering if it should need capacitor (maybe between the analog input and the pic) to solve the problem. So i will make some test with capacitor
 
Last edited:

I will go now to check it. I was afraid, that maybe was a software problem. Maybe after the first quarter (of the line), didn't store all the value to the lookup table. So if in some position of the address of the lookup table it didn't store anything (so we have 0 Volt) so maybe this will be the reason that it go down to 0 Volt and the return back.
Thank you very much Keith for the help
 

I didn't find the solution yet. I will check again the code and the potentiometer if it work fine. Maybe the potentiometer "jump" some values (for example from 2.3 Volt goes to 2.6 Volt) so maybe this the reason that i have this graphic.

I have make the calculation in Excel and i find out that the output from the inverse, "jump" some values (for example from 2.3 goes to 2.6). So this is the reason that i have this graphic because in some address of the lookup table didn't store anything.

I don't know if i can make something about this.

Finaly i find the solution. It was programmable problem.
Thank you Keith for the help
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top