In MEGA 2560, making triangular waves over 300kHz

You might start researching op-amp integrator circuits.