At the moment, I am assuming that clocks and GPIOs are correctly initialized.
I need a better description of the relationship between sampling trigger and square wave frequency. Is the sampling trigger frequency 1 MHz ? What is the square wave frequency ? How are you sorting out the triple conversion results to reconstruct the square wave at the trigger frequency ? A signal 1 V pp suggests the signal is sometimes negative. Do you really mean that the signal goes from 0.5 mV to 1 V ? Cheers, Hal