I am working on am automotive project that adapts a sensor with with a fairly linear signal to work on a system that normally accepts a very non-linear signal.
I have algebraically worked out a formula that will correct the signal; Vout=3091.99(Vin/.0383)^-1.798. However this is for a decimal input. I will be using, unless something better is recommended, a 10 bit A/D converter with a 5 volt reference and matching it with a 10 bit D/A converter also with a 5 volt reference, so each step is approx .0048 volts. I am just starting in this so I am having trouble wrapping my head around this. I need to read the A/D converter and run it threw the formula, then spit the answer back out a D/A converter. But I can't figure out how to program the formula in a way that will work in the PIC. Any help will be greatly appreciated. I was planning on using a 16f**, but like I said if y'all know better please tell me.
P.S. wish there was a beating head on wall smiley
I have algebraically worked out a formula that will correct the signal; Vout=3091.99(Vin/.0383)^-1.798. However this is for a decimal input. I will be using, unless something better is recommended, a 10 bit A/D converter with a 5 volt reference and matching it with a 10 bit D/A converter also with a 5 volt reference, so each step is approx .0048 volts. I am just starting in this so I am having trouble wrapping my head around this. I need to read the A/D converter and run it threw the formula, then spit the answer back out a D/A converter. But I can't figure out how to program the formula in a way that will work in the PIC. Any help will be greatly appreciated. I was planning on using a 16f**, but like I said if y'all know better please tell me.
P.S. wish there was a beating head on wall smiley