As a mistake,I wrote this to my arduino mega.After that it is restarted speedly and cannot write an another to it.Please help to this
thanx :frowning:

#include <avr/io.h>
#include <avr/wdt.h>

void setup() {

while(1) {};

void loop() {

reburning the bootloader via ISP will do the trick - your problem is that the WDT stays running after reset, so the bootloader never gets a chance to run since it doesn’t know to reset it.