Ok adding pull down resistors and properly poking trisB fixed my problem. New problem is the altimeter is detecting apogee when it is just sitting there immediately after the acceleration arms it. I have coded it such that if the current reading is more than 15 units bigger than the previous reading then it triggers an apogee event. However it is immediately triggering an apogee event, a previous datalogger using the same PIC/ADC and pressure sensor only have +/- unit of 'bit jitter' when stationary, so I can't see how currently two readings at the same pressure would be 15 units different.
Here is the code in which the new problem is.
Code:
launched: poke ADCON0 , $91
pause 1
poke ADCON0 , $95
pause 5
peek ADRESH,B6
Peek ADRESL,B7
W6 = W6 + 15
if W3 > W6 then apogee
W6 = W3
goto launched
EDIT: hahahaha oops, look at my code, I was placing the lower half of the 10 bit A/D result at the top of the word and the upper half on the bottom half of the word. As such the +/- 1 unit of bit jitter would have a huge difference. Why do I always only catch these things after posting them.
EDIT2: Except now the circuit is instantly arming and delaying by a random number before thinking it's at apogee, this is really annoying me.
Bookmarks