Hi James,

What you're trying to do is quite possible to accomplish. I'd still use a different(gauge or differential) sensor if i only wanted to monitor and display the pressure. If i wanted to control the engine i'd choose teh absolute type(the one you have now). The reason for this is that when controling the engine it's interesting to know the absolute pressure since the air contains different ammounts of oxygen at different pressures. If all i wanted to do was to monitor(and display) the pressure relative to the atmosperic pressure, i'd use a gauge(or differential) sensor since that sensor gives an output relative to the sourrounding(atmosperic) pressure. This way i'd get rid of the need to calibrate and also the errors created when the atmosperic pressure is changing. Imagine this scenario - Start your engine at sealevel, it will now be calibrated. Drive up a mountain 2 miles high, your sensor will still show pressures relative to sealevel but the atmosperic will now be a lot less. If this error doesn't bother yoy then you can go ahead with the design as you have planned, if not, it's time to buy another sensor.

Over to the program, there are a few things that needs to be changed.
1. You have a subroutine named "display3" ending with a return, but you never call it. Instead you've put it in the mainloop. Big nono, the return will cause the stack to underflow.
2. The lookup statement should not contain any "0=PortB" or similar.
3. TrisB should be zero for all outputs.
4. Poke is allowed but it doesn't look good. I'd use "PortB=".....
5. It could be a good idea to use more descriptive names on your variables, "psitimes100" is used almost everywhere for almost everything. It will work but will be awful to read when the program grows.

The program could look like this with the errors removed......

DEFINE OSC 20
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 10
TRISA = %11000001 'set portA
ADCON1 = %10000010 'read as analog
RAW VAR WORD 'Set ADC value to name of RAW
ADCIN 0, RAW 'READ ADC store value to RAW
millivolts VAR WORD
psitimes100 var word
millivolts = RAW */ 1250 'convert ADC to millivolts
psitimes100 = millivolts ** 47527 'convert millivolts to psi*100
psitimes100 = psitimes100 + 145 ' add sensor offset
TRISB = %00000000 'set portB all outputs


Main:
GOSUB display3
Goto Main

display3: psitimes100 = psitimes100 / 100 ' Find number of hundreds
psitimes100 = psitimes100 // 100 ' Remove hundreds from psitimes100
Gosub bin2seg ' Convert number to segments
PortB = psitimes100 ' Send segments to LED
PortA.3 = 0
Pause 1 ' Leave it on 1 ms
PortA.3 = 1' Turn off digit to prevent ghosting
psitimes100 = psitimes100 / 10 ' Find number of tens
psitimes100 = psitimes100 // 10 ' Remove tens from psitimes100
Gosub bin2seg ' Convert number to segments
PortB = psitimes100 ' Send segments to LED
PortA.4 = 0 ' Turn on second digit
Pause 1 ' Leave it on 1 ms
PortA.4 = 1
psitimes100 = psitimes100 ' Get number of ones
Gosub bin2seg ' Convert number to segments
PortB = psitimes100 ' Send segments to LED
PortA.5 = 0' Turn on first digit
Pause 1 ' Leave it on 1 ms
PortA.5 = 1
Return ' Go back to caller

bin2seg: Lookup psitimes100, [%00111111, %00000110, %01011011, %01001111, %01100110, %01101101, %01111101, %00000111, %01111111, %01101111], psitimes100
Return

I haven't looked at the AD settings, i'm not familiar with your chip(F818).

The mud is getting less murky......
/Ingvar