Control CPU PWM fan with photon

I have a Photon and a Phobot shield which I’m trying to use to control a 4-pin CPU fan. If you’re not familiar with these fans, the pins are +12V, GND, a PWM input for controlling the speed and a tach output for reading it back.

I’ve got the fan wired up as follows: +12V and GND are connected to the M1 screw terminals, which are controlled by a FET on D7, and the PWM input is connected to the D4 pin via the “T” pinout for the sonar. Yes, I know D4 is not a PWM pin… I’ll probably jump it to another pin that is, but for now I’ve got a voltage issue.

My issue is this: the fan internally contains a pullup resistor between a +5V source and the PWM. If I put D4 in high impedance and turn on the fan, I see about ~4.5V on the pin. If I pull D4 low, the voltage stays the same - the pin can’t pull the line down by any amount I can detect.

Figuring that the +5V in the fan comes from a voltage divider, I measured resistances:
* GND to PWM is around 100k
* PWM to +12V is around 10M
* GND to +12V is around 10M

Any suggestions? I can’t understand why the D4 pin can’t pull down the line - the specs on PWM fans say you need to be able to sink a couple of mA, it shouldn’t be a problem…

Would be helpful to show how you set up the pin and are controlling it.

I was flipping pins both in firmware (code-flash-code-flash :D) and Tinker.

At this point, I’m starting to think I had a short early on in the wiring (things were moving around a lot) and just fried that pin. I can’t get any voltage off it when I take the Photon out of the circuit and flip it in tinker, though the nearby ones work. As an added bonus I fried the voltage regulator on the Phobot too, VIN is reading 2.5V and the photon either won’t start or powers off randomly. In other words… I had a fun and destructive Monday.

Since I likely won’t know what the issue was for certain, I’m planning to build a custom board for this project that will drain the PWM through a transistor driven by the pin instead of directly through the pin. Probably paranoid but it’s a permanent install and I want a more compact board anyway.

But… just to make sure I’m not missing something: if the pins are 5V tolerant and can drain 20mA and the specs for the fan say 5V pullup and 5-10mA drain, there’s no reason that I shouldn’t be able to connect the PWM wire directly to the pin and pull it low right?