AN1924 Motorola / Freescale Semiconductor, AN1924 Datasheet - Page 14

no-image

AN1924

Manufacturer Part Number
AN1924
Description
AN1924 Interfacing Serial LCDs to a DSP56F805s SCI and Porting Code Using the Embedded SDK
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
Converting SDK-Based Code
14
}
/* This procedure is called when it is determined that the user desires
void BaroAdj( int SciFD, Word32 *padj )
{
}
close(SerialMaster);
to enter a correction term to the barometric pressure measurement to
compensate fo 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( SciFD, NewScr, 1 );
PosCursor[1] = 22;
write( SciFD, PosCursor, 2);
write( SciFD, astring, strlen(astring));
PosCursor[1] = 42;
write( SciFD, PosCursor, 2);
write( SciFD, bstring, strlen(bstring));
icount = 0;
while (true)
{
/* Send result to LCD
}
Vcount = (sum >> 6);
/* Compute Barometric pressure in millibars, the following
BaroPress = (278 * Vcount + 108093) >> 10;
BaroPress += BAdj;
PosCursor[1] = 42;
write( SciFD, PosCursor, 2);
sprintf( astring, "P = %ld mbars", BaroPress );
write( SciFD, astring, strlen(astring) );
read( SciFD, &iarray[icount], 1 );
/* process sleeps for 1 msec. */
nanosleep( &OneMillisecond, NULL );
DataStore[i] = Datain;
sum += Datain;
expression uses 32-bit arithmetic and 10 bit left on
all coefficients, equation scaled for millibars and a
12 bit ADC is
Equation taken from MPX4115A Tech Data sheet
icount, temp, i, tenpow;
P = 0,271267*Vcount + 105.56
Interfacing LCDs and Porting Code
/* Set Cursor position in LCD */
*/
/* accumulate measurements for */
/* batch averaging
*/
*/

Related parts for AN1924