Program Uploading error

I was using arduino mega 2560 for driving a robot, for the motor i need 24 volt, when i applied 24v at external driver circuit, at that time my laptop as well as arduino get turn off, now when i am uploading program to arduino it gives me the following error

avrdude: stk500v2_ReceiveMessage(): timeout

please help me

A drawing how you wired everything at the time that it went wrong would help. If you connected 24V directly or indirectly to any of the pins of the Arduino (power, IO), you have probably blown your Mega to the big chip heaven.

That is not the error you got. That is a small piece of the error you got. Post the whole thing.

Also try the loopback test.

If you got 24v on any of the data lines, that would probably trash the board, though.

the message that give me the compiler is
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

i also tried to perform loop back test but it also give me no result. the supply that i have applied on one of the pin of driver ic (this supply is the requirement for driving motor) and arduino was connected to another pin of the same ic.