Linear Technology DC955A - LTC2483 16-bit Delta-Sigma ADC demo board (req. DC590) DC955A DC955A Scheda Tecnica
Codici prodotto
DC955A
LTC2483
2483fc
applicaTions inFormaTion
// If read_LTC2483() does not return non-zero within this time period, something
// is wrong, such as an incorrect i2c address or bus conflict.
// is wrong, such as an incorrect i2c address or bus conflict.
if((x = read_LTC2483(LTC248XADDR)) != 0)
{
// No timeout, everything is okay
timeout = 0; // reset timer
x ^= 0x80000000; // Invert MSB, result is 2’s complement
voltage = (float) x; // convert to float
voltage = voltage * 5.0 / 2147483648.0;// Multiply by Vref, divide by 2^31
lcd_putc(‘\f’); // Clear screen
lcd_gotoxy(1,1); // Goto home position
printf(lcd_putc, “V %01.4f”, voltage); // Display voltage
}
else
{
++timeout;
}
if(timeout > 200)
{
timeout = 200; // Prevent rollover
lcd_gotoxy(1,1);
printf(lcd_putc, “ERROR - TIMEOUT”);
delay_ms(500);
}
} // End of main loop
} // End of main()
{
// No timeout, everything is okay
timeout = 0; // reset timer
x ^= 0x80000000; // Invert MSB, result is 2’s complement
voltage = (float) x; // convert to float
voltage = voltage * 5.0 / 2147483648.0;// Multiply by Vref, divide by 2^31
lcd_putc(‘\f’); // Clear screen
lcd_gotoxy(1,1); // Goto home position
printf(lcd_putc, “V %01.4f”, voltage); // Display voltage
}
else
{
++timeout;
}
if(timeout > 200)
{
timeout = 200; // Prevent rollover
lcd_gotoxy(1,1);
printf(lcd_putc, “ERROR - TIMEOUT”);
delay_ms(500);
}
} // End of main loop
} // End of main()