How to setup Arduino to 8mhz properly?

Hello again, I tried a lot of things and finally I found that the IRremote problem is produced by a bjt NPN attached to pin 6 in PWM mode, the transistor is BC547 (max 100mA) and it is used to power (with GND) a 5v@200mA fan, and also was added a transients protection diode between GND (from the bjt output) and +5V . If change the bjt, resistor, fan and the diode, and if I connect a led with the mandatory resistor, all work as expected both 16Mhz and 8Mhz (except millis, that is not accurate, isn´t a problem). So the internal clock is not the problem, it´s hardware problem.

This will be posted in the hardware section, in adittion, if anyone can tell me a theory of what is happening would be great :slight_smile:

Thanks!!