AN1921 Motorola / Freescale Semiconductor, AN1921 Datasheet - Page 18

no-image

AN1921

Manufacturer Part Number
AN1921
Description
AN1921 General DSP568xx Interface Examples using the Embedded SDK
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Integrating Devices With the EVM Board
18
}
/* This procedure is called when it is determined that the user desires
void BaroAdj( int Uart, Word32 *padj )
{
//
//
}
close(SerialMaster);
to enter a correction to the barometric pressure measurement to
compensate for the altitude above sea-level of the sensor.
It is expected that the user will provide the pressure adjustment in
Millibars.
char astring[]={"Baro Height Adj\n"};
char bstring[]={"Enter (mb) = "};
char iarray[8];
int
write( Uart, NewScr, 1 );
PosCursor[1] = 22;
write( Uart, PosCursor, 2);
write( Uart, astring, strlen(astring));
PosCursor[1] = 42;
write( Uart, PosCursor, 2);
write( Uart, bstring, strlen(bstring));
PosCursor[1] = 42;
}
Vcount = (sum >> 6);
/* Compute Barometric pressure in millibars, the following
BaroPress = (278 * Vcount + 108093) >> 10;
BaroPress += BAdj;
write( Uart, PosCursor, 2);
/* Send result to LCD
sprintf( astring, "P = %ld mbars", BaroPress );
write( Uart, astring, strlen(astring) );
BaroPress = (Vcount >> 2) + (Vcount >> 6) + (Vcount >> 8)
/* process sleeps for 1 msec. */
nanosleep( &OneMillisecond, NULL );
DataStore[i] = Datain;
sum += Datain;
expression uses 32-bit arithmetic and 10 bits left shift on
all coefficients, equation scaled for millibars and a
12 bit ADC is
Original equation taken from MPX4115A Tech Data sheet.
icount, temp, i, tenpow;
Interface Examples Using the Embedded SDK
*/
P = 0.271267*Vcount + 105.56
+ 105;
/* Set Cursor position in LCD */
*/
*/

Related parts for AN1921