I am making a simple voltage regulator. The whole idea is to just use ADC to read voltage on output side and based on the result, adjust PWM power. I am using PWM on physical pin 5. That's the same pin as the one connected to Arduino pin 10 on this image below:

![image description](https://i.stack.imgur.com/ggIkw.png)

This means that if I try to flash the program, ATTiny will start to put PWM power into my Arduino. I don't want that to happen. How can I flash the program safely? Can I do something to prevent it from starting?
['https://arduino.stackexchange.com/questions/32201', 'https://arduino.stackexchange.com', 'https://arduino.stackexchange.com/users/2955/']
> 
> This means that if I try to flash the program, ATTiny will start to put PWM power into my Arduino. I don't want that to happen.
> 
> 
> 

Why do you think that is a problem? The "PWM power" cannot be any higher than the supply voltage, and that is 5V. The Arduino has no problem with you providing a 5V PWM signal to an input pin.

The only time it could be a problem is if the pin you are sending the PWM to is set to an output, in which case you could risk overloading the pin. To get around that you just need to insert a small resistor between the ATTiny's pin and the Arduino's pin. 330Ω or so should do it. Just enough to limit the current to a safe value (< 20mA) but small enough that it won't interfere with the programming communication.

A well design schematic for an Arduino ICSP programmer would have had these resistors in all the data communication lines anyway.
The Arduino-as-ISP sketch will turn all the OUTPUT pins, connected to the ATTiny, [back to **INPUT**](https://github.com/arduino/Arduino/blob/2bfe164b9a5835e8cb6e194b928538a9093be333/build/shared/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino#L433-L439). That way nothing bad can happen, when the ATTiny drives those pins HIGH of LOW.