Hello,
Im having an issue replicating Pulse Stretching method from this article
http://pcbheaven.com/circuitpages/PWM_3_Wires_Fan_Controller_with_RPM_feedback/My test platform uses ATmega128A, i have no problems with software side, its the hardware that gives me the headache.
The biggest issue im getting is at the very beginning when i want to simply start measuring TACH signal.
The issue is that when i connect TACH signal to pullup resistor to 5V to make it logic level (the fans are powered from nominal 12V with PWM control) and then connect TACH signal to MCU GPIO there is a significant drop in FAN RPM.
How significant? My fans need 30% PWM to start up when TACH pin is unconnected. When i connect it they need at least 60%. And other way around when im running fan without TACH connected at 70% and then i connect pullup to TACH and to GPIO the RPM drops to so low that fan almost stalls.
Fan is powered with 12V while the speed is controlled by 41kHz (also tested with 10kHz and 20kHz) PWM from MCU trought a N-Mosfet transistor.
Im attaching schematic how i connected PWM, N-MOS and FAN

At first i was told the issue might be too low pullup resistor. So from 10k i increased it to 82k. Only thing it did was that i could now safely connect it to TACH signal without having that "slow down" effect BUT still when i was about to measure TACH and i connected it to GPIO the RPM drop happened anway (and further increase in PD resistor didnt change anything).
I was thinking it might be because i try to use 5V as pullup voltage, so i wanted to pull it to 12V and then use photocoupler to switch level to 5V but just like before when i connected pulled up TACH signal (now to 12V) to the diode terminal of photocoupler the moment i connected ground nodes fan slowed down again.
I also tried using method of article author and switch the logic level of signal using 5.1 zener diode, but even adding that diode to circuit makes fan rotate slower and even with diode in circuit i was seeing high voltages on meter (above 7V despite fact that if fan TACH signal is always 50% duty then it whould not exceed 6V at any moment) .
I tested 3 fans and all behave the same when driven with PWM (when directly from adjustable DC its all fine).
When the fan slow down starts there is absolutely no voltage drop in circuit, the 12V on source remains 12V and 5V remains 5V.
When the fan slow down starts, despite RPM drop FAN current draw increases by approx 30mA from what it is usually.
The 12V supply and 5V supply have common ground and are coming from same source (PC PSU).