Blinking D13 Led on using external power

when I power my arduino using usb , it works fine ... but when i use external power supply the D13 LED starts blinking rapidly... Any ideas?

"external power supply"?

Connected to what? 5V and GND? VIN and GND? The USB connector?

9V DC to GND and Vin

What's the 9V source?

9V DC battery

I assume you mean one of those small rectangle batteries used in smoke detectors.

Those are absolutely lousy power sources. They are only designed to provide loads around 25mA-50mA.

Your behavior is usually caused by a 9V that is depleted.