Mike,
I have a DS1307 triggering an interrupt at 1hz. When the trigger fires I update the screen as follows:
/// <summary>
/// Layout of screen 2
/// </summary>
static void screen2()
{
//Title
paint.Print(2, 0, "e-Home Data Logger");
//Table
paint.RectSE(40, 18, 127, 27); //top rectangle
paint.RectSE(0, 27, 127, 63); //big rectangle
paint.Line(0, 36, 127, 36); //horizontal line 1
paint.Line(0, 45, 127, 45); //horizontal line 2
paint.Line(0, 54, 127, 54); //horizontal line 3
paint.Line(40, 18, 40, 63); //vertical line 1
paint.Line(80, 18, 80, 63); //vertical line 2
//Header
paint.PrintSmall(42, 19, "Counter");
paint.PrintSmall(82, 19, "Consumption");
//Labels
paint.PrintSmall(2, 28, "E-Day");
paint.PrintSmall(2, 37, "E-Night");
paint.PrintSmall(2, 46, "Gas");
paint.PrintSmall(2, 55, "Water");
DisplayFlush();
}
/// <summary>
/// Changing values of screen 2
/// This is called every second
/// </summary>
public static void updatescreen2()
{
if (timerenabled)
{
// Time
DateTime t = DateTime.Now;
paint.PrintSmall(1, 19, t.TimeOfDay.ToString().Substring(0,8));
paint.PrintSmall(1, 10, FEZ_Panda_LCD_128x64.Program.uptime.ToString());
//Counter Data
paint.PrintSmall(42, 28, " ");
paint.PrintSmall(42, 28, CounterCollection.EDCounter.ToString("F3"));
paint.PrintSmall(42, 37, " ");
paint.PrintSmall(42, 37, CounterCollection.ENCounter.ToString("F3"));
paint.PrintSmall(42, 46, " ");
paint.PrintSmall(42, 46, CounterCollection.GACounter.ToString("F3"));
paint.PrintSmall(42, 55, " ");
paint.PrintSmall(42, 55, CounterCollection.WACounter.ToString("F3"));
//Consumption Data
if (CounterCollection.HighRate)
{
paint.PrintSmall(82, 28, " ");
paint.PrintSmall(82, 37, " ");
paint.PrintSmall(82, 28, CounterCollection.EDCons.ToString("F0") + " Watt");
}
else
{
paint.PrintSmall(82, 28, " ");
paint.PrintSmall(82, 37, " ");
paint.PrintSmall(82, 37, CounterCollection.EDCons.ToString("F0") + " Watt");
}
//shit happens here. If these 4 lines are commented out, it keeps running nice.
paint.PrintSmall(82, 46, " ");
paint.PrintSmall(82, 46, CounterCollection.GACons.ToString("F1") + " m3/h");
paint.PrintSmall(82, 55, " ");
paint.PrintSmall(82, 55, CounterCollection.WACons.ToString("F1") + " L/m");
if (CounterCollection.HighRateTest)
{
paint.ClearCirlcle(35, 41, 2);
paint.Cirlcle(35, 32, 2);
}
else
{
paint.ClearCirlcle(35, 32, 2);
paint.Cirlcle(35, 41, 2);
}
DisplayFlush();
}
}
static void DisplayFlush()
{
FEZ_Extensions.Large128x64Display.Flush(paint.vram);
}
Maybe I’m pushing too much data to the sceen?
PS: The Debug.GC(true) didn’t help.