Hello everyone! Since y'all were able to run the code, I though that there must be some issue with the oscilloscope settings. I spoke to my colleague who uses the oscilloscope often and he switched the coupling mode of the oscilloscope which solved the clipping issue. No I can see a full sine wave at 1 kHz from 0 to 3.3 V. Thanks a lot for all your help and support!