avrdude error while uploading

With an option... Putting series resistors on the MOSI, MISO, and SCK connections will protect both sides. Anything between 220 ohms to 1000 ohms is a good choice.