Serial LCD is connected to an DUE via WIRE.
Removed pull up from board and not using Serial LCD pull ups.
Pull up on interface board are 4.7K.
The Init code is this
Wire.begin();
Wire.setClock(400000); //Optional - set I2C SCL to High Speed Mode of 400kHz
lcd.begin(Wire);
lcd.disableSystemMessages();
lcd.setBacklight(255, 255, 255); //Set backlight to bright white
lcd.setContrast(5); //Set contrast. Lower to 0 for higher contrast.
The code updating the display is:
lcd.clear();
bout << dec << setw(2) << setfill('0') << (uint16_t)OutputData.hour << F(":") << dec << setw(2) << setfill('0') << (uint16_t)OutputData.min << F(":") << dec << setw(2) << setfill('0') << (uint16_t)OutputData.sec;
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
bout << dec << setw(2) << setfill('0') << (uint16_t)OutputData.month << F("/") << dec << setw(2) << setfill('0') << (uint16_t)OutputData.day << F("/") << dec << setw(4) << setfill('0') << (uint16_t)OutputData.year;
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
bout <<F("Spd:") << dec << setw(4)<< setfill(' ') << (((uint32_t)OutputData.gSpeed * 36) / 10000);
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
bout << F("Alt:") << dec << setw(4)<< setfill(' ') << ((uint32_t)OutputData.height / 1000);
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
bout << F("Fix: ") << dec << (uint16_t)OutputData.gpsFix;
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
bout << F("Dir:") << dec << setw(4)<< setfill(' ') << ((uint32_t)OutputData.headMot / 100000);
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
if (GPS_calibrated)
{
bout << F("xAcl:") << dec << setw(4)<< setfill(' ') << (((uint32_t)OutputData.xAccel) / 100);
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
LCDEntry++;
bout << F("Ptch:") << dec << setw(4)<< setfill(' ') << ((uint32_t)OutputData.pitch / 100000);
BuffLCDOutput (obuffer, LCDOutColumn[LCDEntry], LCDOutRow[LCDEntry]);
bout.seekp(0);
According to micros(), the code runs in 0.48ms, repeatably but it take the disply 2 seconds to update.
Why?
To be complete, the subroutine called here is:
void BuffLCDOutput (char abuffer[], const uint8_t column, const uint8_t row)
{
lcd.setCursor(column, row);
lcd.write(abuffer);
}
Thanks for any help in advance.