Hi Guys,
i have some trouble to put informations on a Display.
I cant figure it out where my errors are, so i’m asking here.
I have following display connected to my Hydra:
http://www.soselectronic.at/a_info/resource/d/BT5.7ADNHW.pdf
I am not sure to configure it, but i think i got this.
here is my Display Configuration:
static void ConfigureDisplayBT5_7()
{
Debug.Print("Display not configured. Configuring mainboard to use display.");
Debug.Print("Mainboard will need to be rebooted when finished");
LCDController.Configurations lcdConfig = new LCDController.Configurations();
//Configuration for BT5.7
lcdConfig.Width = 640;
lcdConfig.Height = 480;
lcdConfig.OutputEnableIsFixed = false; // no fixed En
lcdConfig.OutputEnablePolarity = true; // active = high
lcdConfig.HorizontalSyncPolarity = true; // active = high
lcdConfig.VerticalSyncPolarity = true; // active = high
lcdConfig.PixelPolarity = false; // Clk Falling Edge
lcdConfig.HorizontalSyncPulseWidth = 1; // Horizontal pulse width
lcdConfig.HorizontalBackPorch = 45; // Horizontal back porch
lcdConfig.HorizontalFrontPorch = 114; // Thf
lcdConfig.VerticalSyncPulseWidth = 1; //Vertical pulse width
lcdConfig.VerticalBackPorch = 33; // Vertical blank
lcdConfig.VerticalFrontPorch = 11; // Tvf
lcdConfig.PixelClockRateKHz = 25000; // Dot Clockrate 25 MHz
LCDController.Set(lcdConfig);
Debug.Print("Mainboard can now be reset");
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
}
my code to make some output for testing is:
public static void Main()
{
if (SystemMetrics.ScreenWidth != 640 || SystemMetrics.ScreenHeight != 480)
ConfigureDisplayBT5_7();
myDisplayTestApp = new Program();
Debug.Print(SystemMetrics.ScreenWidth + "W x " + SystemMetrics.ScreenHeight + "H");
myDisplayTestApp.MainWindow = CreateWindow();
myDisplayTestApp.MainWindow.Visibility = Visibility.Visible;
myDisplayTestApp.MainWindow.Background = new SolidColorBrush(Colors.Red);
timer.Start();
myDisplayTestApp.Run(myDisplayTestApp.MainWindow);
}
private static Window CreateWindow()
{
Window wnd = new Microsoft.SPOT.Presentation.Window();
wnd.Background = new SolidColorBrush(Colors.Black);
Bitmap bm = new Bitmap(200, 200);
bm.DrawText("Test Output", Resources.GetFont(Resources.FontResources.NinaB), Colors.Green, 25, 10);
bm.Flush();
wnd.Child = new Microsoft.SPOT.Presentation.Controls.Image(bm);
wnd.Visibility = Visibility.Visible;
wnd.Invalidate();
return wnd;
}
Sorry for my bad english,
Best regards from Austria,
and thanks for your help.
Arnold