Generating a 1Mhz Pulse

Hey guys, I'm new to arduino and I need help.
My project requires me to generate a 1Mhz pulse from the Atmega328 Arduino. How do I go about doing that? Any ideas?
Thanks in advance.

There is a library called FrequencyTimer2 that can toggle a pin aa user defined periods as short as 1 microsecond. I have not tried running it that fast but its worth a go. See: Arduino Playground - FrequencyTimer2

Install the library and add this code to your setup:

pinMode(11,OUTPUT); // frequencyTimer2 is hard coded to output on this pin
FrequencyTimer2::setPeriod(1); // 1us
FrequencyTimer2::enable(); // start toggling

I would be interested to read how you get on.