Hi!

I am new to the forum (actually always have used the forum for searching and consulting but never registered...) and Iīd like to know if you can help me out.

I am designing a rocket altimeter using pic 12F683 and reading a MPX4115 pressure sensor. What I need to do is to read de ADC value, convert it to height using a equation and compare the values obtained as the rocket goes up. Then, when the height measured is lower than the previous one, a servo is activated.

All of this is already implemented and ""working"" (I am very very new to this) except for the fact that the servo is being activated during the "ascent of the rocket" (I am simulating the circuit in proteus) because the AD reading is changing faster than the PIC can do the conversion of AD to height. I know that because I put a 200ms pause after the conversion and it worked just fine. Without the pause I think it gets "confused" about the value to use to make the comparision.

The problem is that I donīt want to use this 200ms pause because Iīm data logging the values in eeprom and 200ms diference between values is too much for a 15 seconds flight. With the 200ms pause I can write only 78 values of height into eeprom, while a 20ms pause allows me to write 242 values (wich is great for a 256 addresses available in eeprom).

So my question (finally) is, how can I contour this problem? Is that a problem with the conversion time (math operations) or the AD reading time? Is there any way to make the conversion faster? I know that the equation I am using (height = (((835-adin)*104)+35)/10) requests some time to be processed but, what would you do in this situation?

As I said, my experience with this stuff is very limited and I hope someone can put some light on this! Thanks a lot!
PS: I didnīt put the code here because it only does that: reads AD, calculates height and compare to previous values to activate (or not) the servo.