I’ve done a project on arduino mega 2560 and want to move it to a pcb that i’ve designed and had manufactured. I’ve soldered everything together and uploaded the blink sketch using usbasp (i have a led on digital pin 4). It run very slowly. After searching with google, i’ve learned that i need to set the fuse bites to use the externel crystal (it’s a brand new atmega 2560). So i’ve burned the bootloader (it’s supposed to set those bytes). Now the blink sketch will upload but won’t do anything, but when i upload:
#define F_CPU 16000000UL
DDRG = (1<<PG5);
PORTG = (1<<PG5);
PORTG = (0<<PG5);
it runs ok. Can anyone help me? How to solve this problem?