480x272 on Cobra in 4.2

PriorityEnable and PixelClockDivider are both missing from 4.2 and try to set the Cobra to use a 480x272 screen without them makes the screen not work.

Can’t find any updated examples of how to do this.

PriorityEnable is now automatic depending on the pixel clock and the divider is replaced with PixelClockRateKHz which you should set to 72000 / PixelClockDivider.

1 Like

NETMF4.2

I have done til without problems on the G120 with a Newhaven screen 4.3" 480 x 272.

PixelClockRateKHz = 9000

(EMX: 72 HHz / 8 = 9000)

But, trying the same with the EMX causing an exception !!!

The thread '<No Name>' (0x2) has exited with code 0 (0x0).
    #### Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (1) ####
    #### Message: 
    #### GHI.Premium.Hardware.Configuration+LCD::Set [IP: 003b] ####
    #### MFW_EMX_Resp_3.Program::SetLCDConfigurations [IP: 005d] ####
    #### MFW_EMX_Resp_3.Program::Main [IP: 0008] ####
A first chance exception of type 'System.NotSupportedException' occurred in GHI.Premium.Hardware.dll
An unhandled exception of type 'System.NotSupportedException' occurred in GHI.Premium.Hardware.dll

The code is:

// Set LCD Configuration for Newhaven NHD-4.3-480272EF-ATXL#-T
        private static void SetLCDConfigurations()
        {
            Configuration.LCD.Configurations lcdConfig = new Configuration.LCD.Configurations();

            lcdConfig.Width = 480;
            lcdConfig.Height = 272;

            lcdConfig.OutputEnableIsFixed = false;
            lcdConfig.OutputEnablePolarity = true;

            lcdConfig.HorizontalSyncPolarity = false;
            lcdConfig.VerticalSyncPolarity = false;
            lcdConfig.PixelPolarity = false;

            lcdConfig.HorizontalSyncPulseWidth = 41;
            lcdConfig.HorizontalBackPorch = 2;
            lcdConfig.HorizontalFrontPorch = 2;

            lcdConfig.VerticalSyncPulseWidth = 10;
            lcdConfig.VerticalBackPorch = 2;
            lcdConfig.VerticalFrontPorch = 2;

            // NOTE: This is used for EMX
            lcdConfig.PixelClockRateKHz = 9000;
            
            // Set config
            if (Configuration.LCD.Set(lcdConfig))
            {
                // New settings were saved, must reboot
                Debug.Print("LCD Configuration Change. Device is rerooting.");
                Microsoft.SPOT.Hardware.PowerState.RebootDevice(false);
            }
        }

@ nsb - If you post your problem in multiple threads you will not get an answer any faster.