Use PowerShell to change your Windows IoT screen resolution

Hi guys,

I am working on a personnal project using Windows IoT, a Raspberry Pi 2, an extension board, couple of colored wires and an LCD 800×480 7″ Touch Screen connected using HDMI.

Only thing that I had to fix was the screen resolution. I was looking my way into the configuration files and found the right configuration file.

Here is how to set a custom resolution into your Raspberry Pi 2 with Windows IoT.

Create a PowerShell Session with the Windows IoT device:

[ps][00:13:29] ~> New-PSSession -ComputerName 192.168.69.10 -Credential (Get-Credential)[/ps]

You will have the return from PowerShell Session creation with all needed informations.

Next step, enter the PowerShell Session:

[ps][00:14:17] ~> Enter-PSSession -Id 2[/ps]

Once in the PowerShell Session change Host location:

[ps][192.168.69.10]: PS C:\Data\Users\Administrator\Documents> Set-Location -Path C:\EFIESP[/ps]

Get the config file content:

[ps][192.168.69.10]: PS C:\EFIESP> Get-Content -Path .\config.txt
init_uart_clock=16000000
kernel_old=1
safe_mode_gpio=8
max_usb_current=1
gpu_mem=32
hdmi_force_hotplug=1
core_freq=250
framebuffer_ignore_alpha=1
framebuffer_swap=1
disable_overscan=1
hdmi_group=2
display_rotate=0
hdmi_mode=14[/ps]

Optionnaly, you can save the original configuration file, using the following command:

[ps][192.168.69.10]: PS C:\EFIESP> Copy-Item -Path config.txt -Destination save-config.txt[/ps]

You need to make at least the following changes:

  • hdmi_mode: needs to be set to 87, there is 86 default different resolutions in Windows IoT and setting it to 87 will specify the custom resolution.
  • hdmi_cvt: needs to be set to “800 480 60 6 0 0 0“using this sets up, put the custom resolution and frequency known at Coordinated Video Timings (CVT).
    • 800 [width]
    • 480 [height]
    • 60 [frame-rate in Hz (Hertz)]
    • 6 [aspect ratio of 15:9]
    • 0 [margins disabled 0/enabled 1]
    • 0 [interlace mode 0 progressive/1 interlace]

Here is the configuration file I set in my Raspberry Pi:

[ps][192.168.69.10]: PS C:\EFIESP> Set-Content -Path .\config.txt -Value ‘init_uart_clock=16000000
>> kernel_old=1
>> safe_mode_gpio=8
>> max_usb_current=1
>> gpu_mem=32
>> hdmi_force_hotplug=1
>> core_freq=250
>> framebuffer_ignore_alpha=1
>> framebuffer_swap=1
>> disable_overscan=1
>> hdmi_group=2
>> display_rotate=0
>> hdmi_mode=87
>> hdmi_cvt 800 480 60 6 0 0 0′[/ps]

Once the file is updated you can restart the Raspberry Pi.

[ps][192.168.69.138]: PS C:\EFIESP> Restart-Computer[/ps]