In MEGA 2560, making triangular waves over 300kHz

Use something based on a 16MHz crystal - first generate a square wave using it and then a filter to convert it to triangular/sawtooth.

Note that you will need high-speed components and proper circuit layout.