Can PWM pins be used as digital Pins?

int motor_in1 = 11;                                    
void setup() {
  pinMode(motor_in1, OUTPUT);
  [-- snip --]
} 

void loop() {
  digitalWrite(motor_in1, HIGH);
  [-- snip --]
}

I used pin 11 for one of the motor inputs (pin 10, 11, 14, or 15 in the module) in TB6612FNG motor driver module. Here is the manual of the module: http://www.nex-robotics.com/images/downloads/tb66fng%20dc%20motor%20driver%20module.pdf

The module's IC fried.

I got a new module and used the digital pins for all the input except pin 9 and 16 (those require PWM input). It worked.

Going back to the old circuit, one thing kept me bugging that why it blew? Of all possible reasons, one is whether using PWM pin for digital input caused this? It seems from looking at online resources that ideally one can use PWM pins as a replacement for digital pins.

So, my question is can PWM pins be used as digital pin safely?

Thanks

naishe: So, my question is can PWM pins be used as digital pin safely?

Yes. The PWM pins (and in most cases the Analog IN pins) can be used as digital I/O pins (pinMode INPUT, INPUT_PULLUP, or OUTPUT).

Great, thanks.

And the "analog" pins as well...

Except for A6, A7 on surface mount '328P equipped boards when they are broken out. Those are analog input only.

CrossRoads:
Except for A6, A7 on surface mount '328P equipped boards when they are broken out. Those are analog input only.

Even those work well for reading switches.

The other day I connected a rotary encoder and two push-buttons to A6/A7 (with suitable resistors to give different voltage levels).

Yes, as digital inputs; will be slow inputs if using regular analogRead() calls. Can be sped up for sure since resolution is not needed.

CrossRoads: Yes, as digital inputs; will be slow inputs if using regular analogRead() calls.

You do what you have to do when there's only two pins left...

I understand totally. I have this really interesting code for a MAX7219 where I have 8 7-segment digits, and I use the 8th bit of each digit as something totally different, took some fine software finagling to work out setting & clearing them independent of the digits being displayed. If I hadn't been between jobs at the time I don't think I would've had time to work that all out.

OP was looking for outputs tho, so not much help there.