Does the circuit work in reality on an actual MCU? If it does, then the simulator is wrong. If it doesn't your program is wrong.
"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."