I have a dual op-amp that I want to use as a comparator: Vin should be compared to Vref (1/2 VCC). This is the circuit that I am using (as I have a dual op-amp, I am using a voltage follower on the divider).
I would expect that if Vin>1.65V, Vout=3.3V (VCC). Otherwise, Vout=0V. Unfortunately, Vout is around 2.2V if Vin>1.65V, which is not sufficient for my µC to detect a clean logic high.
I suspect that I am experiencing an "ideal vs. real-world" op-amp problem, but I am not sure how to resolve it best.