3–259
Motorola Sensor Device Data
For More Information On This Product,
Go to: www.freescale.com
0B03 B7 01 STA $01
0B05 BE 54 LDX $54 porta = ( lcdtab[digit[4]] ); /* 1’s digit */
0B07 D6 08 00 LDA $0800,X
0B0A B7 00 STA $00
/* place the decimal point only if the sensor is 15 psi or 7.5 psi */
0B0C B6 60 LDA $60 if ( sensor_index < 3 )
0B0E A8 80 EOR #$80
0B10 A1 83 CMP #$83
0B12 24 08 BCC $0B1C
0B14 BE 54 LDX $54 porta = ( lcdtab[digit[4]]+1 ); /* add the decimal point to the lsd */
0B16 D6 08 00 LDA $0800,X
0B19 4C INCA
0B1A B7 00 STA $00
0B1C 3D 60 TST $60 if(sensor_index ==0) /* special case */
0B1E 26 0F BNE $0B2F
{
0B20 BE 54 LDX $54 porta = ( lcdtab[digit[4]] ); /* get rid of the decimal at lsd */
0B22 D6 08 00 LDA $0800,X
0B25 B7 00 STA $00
0B27 BE 53 LDX $53 portb = ( lcdtab[digit[3]]+1 ); /* decimal point at middle digit */
0B29 D6 08 00 LDA $0800,X
0B2C 4C INCA
0B2D B7 01 STA $01
}
0B2F 9A CLI CLI;
0B30 CD 09 68 JSR $0968 delay();
0B33 81 RTS }
/****************************************************************/
void display_psi(void)
/*
At power–up it is assumed that the pressure or vacuum port of
the sensor is open to atmosphere. The code in initio() delays
for the sensor and power supply to stabilize. One hundred A/D
conversions are averaged. That result is called xdcr_offset.
This routine calls the A/D routine which performs one hundred
conversions, divides the result by 100 and returns the value.
If the value returned is less than or equal to the xdcr_offset,
the value of xdcr_offset is substituted. If the value returned
is greater than xdcr_offset, xdcr_offset is subtracted from the
returned value.
*/
{
while(1)
{
0B34 CD 09 7F JSR $097F atodtemp = read_a2d(); /* atodtemp = raw a/d ( 0..255 ) */
0B37 3F 55 CLR $55
0B39 B7 56 STA $56
0B3B B0 5D SUB $5D if ( atodtemp <= xdcr_offset )
0B3D B7 58 STA $58
0B3F B6 5C LDA $5C
0B41 A8 80 EOR #$80
0B43 B7 57 STA $57
0B45 B6 55 LDA $55
0B47 A8 80 EOR #$80
0B49 B2 57 SBC $57
0B4B BA 58 ORA $58
0B4D 22 08 BHI $0B57
0B4F B6 5C LDA $5C atodtemp = xdcr_offset;
0B51 B7 55 STA $55
0B53 B6 5D LDA $5D
0B55 B7 56 STA $56
0B57 B6 56 LDA $56 atodtemp –= xdcr_offset; /* remove the offset */
0B59 B0 5D SUB $5D
0B5B B7 56 STA $56
0B5D B6 55 LDA $55
0B5F B2 5C SBC $5C
0B61 B7 55 STA $55
0B63 CD 09 4C JSR $094C sensor_slope(); /* establish the slope constant for this output */
0B66 B6 56 LDA $56 atodtemp *= sensor_model;
0B68 B7 58 STA $58
0B6A B6 55 LDA $55
0B6C B7 57 STA $57
0B6E B6 5E LDA $5E
F
Freescale Semiconductor, Inc.
n
.