Recently I upgraded my CPU from Ryzen 5 1600 to Ryzen 5 5600x but I'm getting random black screen restarts. I managed to fix it by manually setting up CPU Frequency and Voltage(VID) Change in BIOS. When this setting was on Auto, my PC randomly restarted, sometimes after 5 hours sometimes on lock screen it is completely random. Everything goes black, screen, mouse and keyboard. After setting this setting to manual values: 4500 MHz and 1.4V my PC is running fine. (I can also use different values: I tried 3700 MHz and 1.3V etc.)
I know it is not overheating because it is running at 50 celsius on idle and max 80 when gaming.
I was also getting this WHEA EVENT ID 18 in Event Viewer.
To troubleshoot I tried: switching PSU-s (750W and 650W)
turning off and on PBO and XMP
switching Windows power plans
fresh installation of Windows 10 and 11
updating BIOS and Chipset for my motherboard
I really don't know why I can't run it on Auto settings.
Also I really want to know what values are best for my CPU (Ryzen 5 5600x) and my motherboard (ASRock B450M Steel Legend.)
If needed rest of my PC: 2x8GB HyperX Predator 3200 MHz
Thermaltake 600W PSU
Sapphire Nitro+ RX 580 4GB with latest drivers
Samsung 970 Evo Plus NVMe 500GB
PNY 240GB SSD
WDC 1000GB HDD
I really hope you can tell me what is wrong with my PC and how can I fix it.