Problems reading a signal with a MCU (TM4C123GXL) input pin
From your explanation, it sounds like you have configured the Op-Amp to output 0-5 V and the microcontroller's digital pin is trying to read a 0-5 V signal. Please note that the microcontroller TM4C123GXL, which you are using, operates with I/O logic levels of 3.3 V and you are using a 5 V logic to drive the microcontroller's digital pin. This appears to be the cause of what you are seeing at the output. 
Have a look at the microcontroller TM4C123GXL's datasheet here : http://www.ti.com/lit/pdf/spmu296&amp;ved=2ahUKEwjP1-DeqPrnAhVkTxUIHYoLDiEQFjAAegQIBxAC&amp;usg=AOvVaw0XulafQFE2JHx9LJ_xC5p-&amp;cshid=1583103090057
As @Ron and @Steve suggested, please provide a schematic of your circuit.